42#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_IMPL_ALLOCATOR_H
43#define LASS_GUARDIAN_OF_INCLUSION_PRIM_IMPL_ALLOCATOR_H
56LASS_DLL void* allocateMemory(
size_t size);
57LASS_DLL void deallocateMemory(
void* mem,
size_t size);
59template <
typename T,
bool hasTrivialConstructorAndDestructor>
63 static T* allocate(
size_t n)
65 return static_cast<T*
>(allocateMemory(n *
sizeof(T)));
67 static void deallocate(T* p,
size_t n)
69 deallocateMemory(p, n *
sizeof(T));
74class AllocatorHelper<T, false>
77 static T* allocate(
size_t n)
81 T* p =
static_cast<T*
>(allocateMemory(n *
sizeof(T)));
82 for (
size_t i = 0; i < n; ++i)
96 static void deallocate(T* p,
size_t n)
101 static void deallocate(T* p,
size_t n,
size_t i)
107 deallocateMemory(p, n *
sizeof(T));
112T* allocateArray(
size_t n)
114 return AllocatorHelper<T, meta::IsTrivial<T>::value>::allocate(n);
118void deallocateArray(T* p,
size_t n)
120 AllocatorHelper<T, meta::IsTrivial<T>::value>::deallocate(p, n);
#define LASS_DLL
DLL interface: import or export symbols?
implementation details of lass::prim
set of geometrical primitives
Library for Assembled Shared Sources.