Allocator for pointer_list
, specialized for NELT
.
More...
#include <pointer_list.h>
template<size_t NELT = 15>
class CxxUtils::pointer_list< NELT >::allocator
Allocator for pointer_list
, specialized for NELT
.
The purpose for thsi is to be able to have the static at_end_static
function, which we can call from an iterator.
Definition at line 254 of file pointer_list.h.
◆ allocator()
template<size_t NELT = 15>
Constructor.
- Parameters
-
nblock | Number of blocks to allocate per chunk. |
◆ allocate()
list_block* CxxUtils::pointer_list_base::allocator::allocate |
( |
| ) |
|
|
inherited |
◆ at_end()
bool CxxUtils::pointer_list_base::allocator::at_end |
( |
const void * |
p | ) |
const |
|
inherited |
Test if P is pointing at the end-pointer of a block.
◆ at_end_static()
template<size_t NELT = 15>
Test if P is pointing at the end-pointer of a block.
◆ nchunks()
size_t CxxUtils::pointer_list_base::allocator::nchunks |
( |
| ) |
const |
|
inherited |
Return the current number of allocated chunks.
◆ nelt()
size_t CxxUtils::pointer_list_base::allocator::nelt |
( |
| ) |
const |
|
inherited |
Return the number of pointers per block (excluding the end-pointer).
◆ refill()
void CxxUtils::pointer_list_base::allocator::refill |
( |
| ) |
|
|
privateinherited |
Allocate a new chunk of blocks.
Definition at line 62 of file pointer_list.cxx.
67 chunk*
ch =
reinterpret_cast<chunk*
> (
p);
70 unsigned long pp =
reinterpret_cast<unsigned long> (
ch+1);
72 ch->m_blocks =
reinterpret_cast<list_block*
> (pp);
◆ END_MASK
template<size_t NELT = 15>
◆ END_OFFS
template<size_t NELT = 15>
Verify that NELT
is one less than a power of two.
Constants to use to test if we're at the end of a block.
Definition at line 262 of file pointer_list.h.
◆ m_chunks
chunk* CxxUtils::pointer_list_base::allocator::m_chunks |
|
privateinherited |
◆ m_end_mask
unsigned long CxxUtils::pointer_list_base::allocator::m_end_mask |
|
privateinherited |
◆ m_end_offs
unsigned long CxxUtils::pointer_list_base::allocator::m_end_offs |
|
privateinherited |
Offset for testing for an end pointer.
Definition at line 161 of file pointer_list.h.
◆ m_nblock
size_t CxxUtils::pointer_list_base::allocator::m_nblock |
|
privateinherited |
◆ m_nchunks
size_t CxxUtils::pointer_list_base::allocator::m_nchunks |
|
privateinherited |
◆ m_nelt
size_t CxxUtils::pointer_list_base::allocator::m_nelt |
|
privateinherited |
Number of elements per block (excluding the end-pointer).
Definition at line 143 of file pointer_list.h.
◆ m_nthis
size_t CxxUtils::pointer_list_base::allocator::m_nthis |
|
privateinherited |
Number of blocks allocated so far from that chunk.
Definition at line 152 of file pointer_list.h.
The documentation for this class was generated from the following file: