31 #ifndef FLANN_ALLOCATOR_H_
32 #define FLANN_ALLOCATOR_H_
51 T* mem = (T*) ::malloc(
sizeof(T)*
count);
98 this->blocksize = blocksize;
117 while (base !=
NULL) {
118 prev = *((
void**) base);
145 if (
size > remaining) {
154 void* m = ::malloc(blocksize);
156 fprintf(stderr,
"Failed to allocate memory.\n");
161 ((
void**) m)[0] = base;
167 remaining = blocksize -
sizeof(
void*) - shift;
168 loc = ((
char*)m +
sizeof(
void*) + shift);
171 loc = (
char*)loc +
size;
186 template <
typename T>
199 return allocator.allocateMemory(
size) ;
void * allocateMemory(int size)
PooledAllocator(int blocksize=BLOCKSIZE)
T * allocate(size_t count=1)
T * allocate(size_t count=1)