ORIGINAL
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
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.
 
namespace  std
 Standard namespace extensions for original::alternative.
 

Functions

template<typename TYPE >
void std::swap (original::objPoolAllocator< TYPE > &lhs, original::objPoolAllocator< TYPE > &rhs) noexcept
 Specialization of std::swap for objPoolAllocator.
 

Detailed Description

Memory allocation interface and implementations.

Provides:

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