MCPcopy Create free account
hub / github.com/WheretIB/nullc / GetBasePointer

Method GetBasePointer

NULLC/StdLib.cpp:405–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void* NULLC::GetBasePointer(void* ptr)
406{
407 // Search in range of every pool
408 if(void *base = pool8.GetBasePointer(ptr))
409 return base;
410 if(void *base = pool16.GetBasePointer(ptr))
411 return base;
412 if(void *base = pool32.GetBasePointer(ptr))
413 return base;
414 if(void *base = pool64.GetBasePointer(ptr))
415 return base;
416 if(void *base = pool128.GetBasePointer(ptr))
417 return base;
418 if(void *base = pool256.GetBasePointer(ptr))
419 return base;
420 if(void *base = pool512.GetBasePointer(ptr))
421 return base;
422 // Search in global pool
423 for(unsigned int i = 0; i < globalObjects.size(); i++)
424 {
425 if(ptr >= globalObjects[i] && ptr <= (char*)globalObjects[i] + *(unsigned int*)globalObjects[i])
426 return (char*)globalObjects[i] + 4 + sizeof(markerType);
427 }
428 return NULL;
429}
430
431void NULLC::CollectMemory()
432{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected