5#ifndef NIRT_ALLOCATOR_HPP_INCLUDED
6#define NIRT_ALLOCATOR_HPP_INCLUDED
8#include <nirtcpp/core/engine/nirt_types.hpp>
18#ifdef DEBUG_CLIENTBLOCK
19#undef DEBUG_CLIENTBLOCK
20#define DEBUG_CLIENTBLOCK new
35 return (
T*)internal_new(
cnt*
sizeof(
T));
47 new ((
void*)
ptr)
T(
e);
58 virtual void* internal_new(
size_t cnt)
60 return operator new(
cnt);
63 virtual void internal_delete(
void* ptr)
82 return (
T*)
operator new(
cnt*
sizeof(
T));
94 new ((
void*)
ptr)
T(
e);
106#ifdef DEBUG_CLIENTBLOCK
107#undef DEBUG_CLIENTBLOCK
108#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
114 ALLOC_STRATEGY_SAFE = 0,
115 ALLOC_STRATEGY_DOUBLE = 1,
116 ALLOC_STRATEGY_SQRT = 2
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Fast allocator, only to be used in containers inside the same memory heap.
Definition irrAllocator.hpp:76
T * allocate(size_t cnt)
Allocate memory for an array of objects.
Definition irrAllocator.hpp:80
void destruct(T *ptr)
Destruct an element.
Definition irrAllocator.hpp:98
void construct(T *ptr, const T &e)
Construct an element.
Definition irrAllocator.hpp:92
void deallocate(T *ptr)
Deallocate memory for an array of objects.
Definition irrAllocator.hpp:86
Very simple allocator implementation, containers using it can be used across dll boundaries.
Definition irrAllocator.hpp:26
void deallocate(T *ptr)
Deallocate memory for an array of objects.
Definition irrAllocator.hpp:39
T * allocate(size_t cnt)
Allocate memory for an array of objects.
Definition irrAllocator.hpp:33
virtual ~irrAllocator()
Destructor.
Definition irrAllocator.hpp:30
void destruct(T *ptr)
Destruct an element.
Definition irrAllocator.hpp:51
void construct(T *ptr, const T &e)
Construct an element.
Definition irrAllocator.hpp:45
eAllocStrategy
defines an allocation strategy (used only by nirt::array so far)
Definition irrAllocator.hpp:113
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11