MCPcopy Create free account
hub / github.com/creatale/node-dv / init

Method init

deps/opencv/modules/core/src/alloc.cpp:229–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227 ~Block() {}
228
229 void init(Block* _prev, Block* _next, int _objSize, ThreadData* _threadData)
230 {
231 prev = _prev;
232 if(prev)
233 prev->next = this;
234 next = _next;
235 if(next)
236 next->prev = this;
237 objSize = _objSize;
238 binIdx = mallocTables.bin(objSize);
239 threadData = _threadData;
240 privateFreeList = publicFreeList = 0;
241 bumpPtr = data;
242 int nobjects = MAX_BLOCK_SIZE/objSize;
243 endPtr = bumpPtr + nobjects*objSize;
244 almostEmptyThreshold = (nobjects + 1)/2;
245 allocated = 0;
246 }
247
248 bool isFilled() const { return allocated > almostEmptyThreshold; }
249

Callers 1

fastMallocFunction · 0.45

Calls 1

binMethod · 0.80

Tested by

no test coverage detected