class ArrayRecycler::Capacity

Declaration

class ArrayRecycler::Capacity { /* full declaration omitted */ };

Description

The size of an allocated array is represented by a Capacity instance. This class is much smaller than a size_t, and it provides methods to work with the set of legal array capacities.

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:71

Member Variables

private uint8_t Index

Method Overview

  • private Capacity(uint8_t idx)
  • public Capacity()
  • public static llvm::ArrayRecycler::Capacity get(size_t N)
  • public unsigned int getBucket() const
  • public llvm::ArrayRecycler::Capacity getNext() const
  • public size_t getSize() const

Methods

Capacity(uint8_t idx)

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:73

Parameters

uint8_t idx

Capacity()

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:76

static llvm::ArrayRecycler::Capacity get(size_t N)

Description

Get the capacity of an array that can hold at least N elements.

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:79

Parameters

size_t N

unsigned int getBucket() const

Description

Get the bucket number for this capacity.

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:87

llvm::ArrayRecycler::Capacity getNext() const

Description

Get the next larger capacity. Large capacities grow exponentially, so this function can be used to reallocate incrementally growing vectors in amortized linear time.

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:92

size_t getSize() const

Description

Get the number of elements in an array with this capacity.

Declared at: llvm/include/llvm/Support/ArrayRecycler.h:84