|
LLVM
4.0.0
|
The size of an allocated array is represented by a Capacity instance. More...
#include <ArrayRecycler.h>
Public Member Functions | |
| Capacity () | |
| size_t | getSize () const |
| Get the number of elements in an array with this capacity. More... | |
| unsigned | getBucket () const |
| Get the bucket number for this capacity. More... | |
| Capacity | getNext () const |
| Get the next larger capacity. More... | |
Static Public Member Functions | |
| static Capacity | get (size_t N) |
| Get the capacity of an array that can hold at least N elements. More... | |
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.
Definition at line 69 of file ArrayRecycler.h.
|
inline |
Definition at line 74 of file ArrayRecycler.h.
Referenced by llvm::ArrayRecycler< T, Align >::Capacity::get(), and llvm::ArrayRecycler< T, Align >::Capacity::getNext().
|
inlinestatic |
Get the capacity of an array that can hold at least N elements.
Definition at line 77 of file ArrayRecycler.h.
References llvm::ArrayRecycler< T, Align >::Capacity::Capacity(), llvm::Log2_64_Ceil(), and N.
|
inline |
Get the bucket number for this capacity.
Definition at line 85 of file ArrayRecycler.h.
|
inline |
Get the next larger capacity.
Large capacities grow exponentially, so this function can be used to reallocate incrementally growing vectors in amortized linear time.
Definition at line 90 of file ArrayRecycler.h.
References llvm::ArrayRecycler< T, Align >::Capacity::Capacity().
|
inline |
Get the number of elements in an array with this capacity.
Definition at line 82 of file ArrayRecycler.h.
1.8.6