JASSv2
Public Attributes | List of all members
JASS::allocator_pool::chunk Class Reference

Details of an individual large-allocation unit. More...

#include <allocator_pool.h>

Collaboration diagram for JASS::allocator_pool::chunk:
Collaboration graph
[legend]

Public Attributes

std::atomic< uint8_t * > chunk_at
 Pointer to the next byte that can be allocated (within the current chunk).
 
uint8_t * chunk_end
 Pointer to the end of the current chunk's large allocation (used to check for overflow).
 
chunknext_chunk
 Pointer to the previous large allocation (i.e. chunk).
 
size_t chunk_size
 The size of this chunk.
 
uint8_t data []
 The data in this large allocation that is available for re-distribution.
 

Detailed Description

Details of an individual large-allocation unit.

The large-allocations are kept in a linked list of chunks. Each chunk stores a backwards pointer (of NULL if not backwards chunk) the size of the allocation and details of it's use. The large block that is allocated is actually the size of the caller's request plus the size of this structure. The large-block is layed out as this object at the start and data[] being of the user's requested length. That is, if the user asks for 1KB then the actual request from the C++ free store (or the Operating System) is 1BK + sizeof(allocator::chunk).


The documentation for this class was generated from the following file: