Quash Shell  0.1
A simple yet powerfull shell program
 All Classes Files Functions Variables Typedefs Enumerations Macros
Public Attributes | List of all members
MemoryPool Struct Reference

Holds a block of memory that can be used for allocations. More...

Public Attributes

void * pool
 
size_t size
 
void * next
 

Detailed Description

Holds a block of memory that can be used for allocations.

The advantage of a MemoryPool is that we can free the entire block at once. This can help prevent memory leaks in code that creates structures from the bottom up (such as the parser) and can fail leaving the top most portion of the structure uninitialized.

Note
A single memory pool can run out of space fast or will take up quite a bit of unnecessary space in memory. To combat this problem the MemoryPoolDeque allows the creation of a larger additional MemoryPool to handle the allocation.

Member Data Documentation

void* MemoryPool::next

The next pointer to be returned from an allocation

void* MemoryPool::pool

Pointer to the top of the memory pool

size_t MemoryPool::size

Size of the memory pool in bytes


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