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
Method Overview
- 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()
Capacity()
Declared at: llvm/include/llvm/Support/ArrayRecycler.h:76
¶static llvm::ArrayRecycler::Capacity get(size_t N)
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
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
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
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