Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs MemoryBlockPoolAllocator

1
2
3
4
5
6
7
8
9
10
module juptune.core.ds.block;

struct MemoryBlockPoolAllocator
{
    /++ FUNCTIONS ++/
    
    /// This is mainly a wrapper that ties together MemoryBlockPool.allocate and MemoryBlockPool.preallocateBlocks . So please see those functions for the bulk of information. 
    Result allocate(ulong powerOfTwo, ulong blockCount, MemoryBlockAllocation allocation);
    
}

Documentation

This is a convenience wrapper around MemoryBlockPoolthat will handle preallocating blocks for you on allocation failure. It's intended as a more configurable, plug-and-play interface to MemoryBlockPoolwith more wider reaching concerns.

This struct does not contain any important state itself, so can be copied around freely. Its total lifetime is directly tied to the lifetime of the underlying pool, so please be careful...

This struct does not contain a destructor, so memory is only freed once the underlying pool is destroyed.

This struct does not prevent other MemoryBlockPoolAllocators from being created for the same pool, so please ensure that all created allocators contain the same configuration to avoid unexpected surprises in allocation behaviour.

Functions

Name Description
allocate

This is mainly a wrapper that ties together MemoryBlockPool.allocateand MemoryBlockPool.preallocateBlocks. So please see those functions for the bulk of information.