31 #ifndef OPENCV_FLANN_ALLOCATOR_H_
32 #define OPENCV_FLANN_ALLOCATOR_H_
51 T* mem = (
T*) ::malloc(
sizeof(
T)*
count);
97 blocksize = blockSize;
112 while (base != NULL) {
113 prev = *((
void**) base);
136 if (size > remaining) {
145 void*
m = ::malloc(blockSize);
147 fprintf(stderr,
"Failed to allocate memory.\n");
152 ((
void**) m)[0] = base;
158 remaining = blockSize -
sizeof(
void*) - shift;
159 loc = ((
char*)m +
sizeof(
void*) + shift);
162 loc = (
char*)loc + size;
177 template <
typename T>
188 #endif //OPENCV_FLANN_ALLOCATOR_H_
int usedMemory
Definition: allocator.h:89
T * allocate(size_t count=1)
Definition: allocator.h:49
void * allocateMemory(int size)
Definition: allocator.h:123
CvSize CvPoint2D32f int count
Definition: calib3d.hpp:221
int wastedMemory
Definition: allocator.h:90
CvSize size
Definition: calib3d.hpp:212
T * allocate(size_t count=1)
Definition: allocator.h:178
const CvMat const CvMat const CvMat CvMat CvMat CvMat CvMat CvSize CvMat CvMat * T
Definition: calib3d.hpp:270
~PooledAllocator()
Definition: allocator.h:108
Definition: allocator.h:74
GLuint GLuint GLsizei count
Definition: core_c.h:973
PooledAllocator(int blockSize=BLOCKSIZE)
Definition: allocator.h:95
const size_t WORDSIZE
Definition: allocator.h:71
const size_t BLOCKSIZE
Definition: allocator.h:72
GLsizeiptr size
Definition: core_c.h:939