MCPcopy Create free account
hub / github.com/Singular/Singular / omIterateTroughBinAddrs

Function omIterateTroughBinAddrs

omalloc/omDebugCheck.c:464–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462 *******************************************************************/
463
464void omIterateTroughBinAddrs(omBin bin, void (*CallBackUsed)(void*), void (*CallBackFree)(void*))
465{
466 omBinPage page;
467 char* addr;
468 int is_free;
469 int i;
470
471 do
472 {
473 page = bin->last_page;
474 while (page != NULL)
475 {
476 addr = (char*) page + SIZEOF_OM_BIN_PAGE_HEADER;
477 i = 0;
478 do
479 {
480 is_free = omIsOnList(page->current, addr) != NULL
481 || omIsInKeptAddrList(addr);
482 if (is_free)
483 {
484 if (CallBackFree != NULL) CallBackFree(addr);
485 }
486 else
487 {
488 if (CallBackUsed != NULL) CallBackUsed(addr);
489 }
490 addr = (char *)((char**) addr) + bin->sizeW;
491 i++;
492 } while (i < bin->max_blocks);
493 page = page->prev;
494 }
495 if (omIsStickyBin(bin))
496 bin = NULL;
497 else
498 bin = bin->next;
499 } while (bin != NULL);
500
501}
502
503void omIterateTroughAddrs(int normal, int track, void (*CallBackUsed)(void*), void (*CallBackFree)(void*))
504{

Callers 1

omIterateTroughAddrsFunction · 0.85

Calls 1

omIsInKeptAddrListFunction · 0.85

Tested by

no test coverage detected