ORIGINAL
Loading...
Searching...
No Matches
allocator.h File Reference

Memory allocation interface and implementations. More...

#include "config.h"
#include "error.h"
#include "maths.h"
#include "type_traits"
#include "utility"
Include dependency graph for allocator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  original::allocators
 Utility class providing static memory allocation/de-allocation functions. More...
 
class  original::allocatorBase< TYPE, DERIVED >
 Interface for other memory allocator implementations. More...
 
class  original::allocator< TYPE >
 Default memory allocator using allocators utilities. More...
 
class  original::objPoolAllocator< TYPE >
 Object pool allocator for efficient fixed-size memory management. More...
 

Namespaces

namespace  original
 Main namespace for the project Original.
 

Detailed Description

Memory allocation interface and implementations.

Provides:

  • Base allocator interface with CRTP support (allocatorBase)
  • Utility functions for raw memory operations (allocators class)
  • Default memory allocator implementation (allocator)
  • Object pool allocator implementation (objPoolAllocator)

Memory Management Hierarchy:

  1. Fundamental operations (allocators class):
    • malloc/free: Raw memory operations using global new/delete
  2. Base interface (allocatorBase):
    • Type-safe allocation interface
    • Object construction/destruction utilities
  3. Implementations:
    • allocator: Simple wrapper around allocators utilities
    • objPoolAllocator: Advanced pool-based allocator with fallback to allocators
Note
All allocators maintain the following guarantees:
  • Type safety through templated interfaces
  • Exception safety (throws allocateError on failure)
  • Nullptr handling for zero-size allocations