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

Function cvRestoreMemStoragePos

deps/opencv/modules/core/src/datastructs.cpp:278–312  ·  view source on GitHub ↗

Restore memory storage position: */

Source from the content-addressed store, hash-verified

276
277/* Restore memory storage position: */
278CV_IMPL void
279cvRestoreMemStoragePos( CvMemStorage * storage, CvMemStoragePos * pos )
280{
281 if( !storage || !pos )
282 CV_Error( CV_StsNullPtr, "" );
283 if( pos->free_space > storage->block_size )
284 CV_Error( CV_StsBadSize, "" );
285
286 /*
287 // this breaks icvGoNextMemBlock, so comment it off for now
288 if( storage->parent && (!pos->top || pos->top->next) )
289 {
290 CvMemBlock* save_bottom;
291 if( !pos->top )
292 save_bottom = 0;
293 else
294 {
295 save_bottom = storage->bottom;
296 storage->bottom = pos->top->next;
297 pos->top->next = 0;
298 storage->bottom->prev = 0;
299 }
300 icvDestroyMemStorage( storage );
301 storage->bottom = save_bottom;
302 }*/
303
304 storage->top = pos->top;
305 storage->free_space = pos->free_space;
306
307 if( !storage->top )
308 {
309 storage->top = storage->bottom;
310 storage->free_space = storage->top ? storage->block_size - sizeof(CvMemBlock) : 0;
311 }
312}
313
314
315/* Allocate continuous buffer of the specified size in the storage: */

Callers 5

icvGoNextMemBlockFunction · 0.85
icvXMLEndWriteStructFunction · 0.85
core_c.hFile · 0.85
icvEndProcessContourFunction · 0.85
cvFindNextContourFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected