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

Method GetBasePointer

NULLC/translation/runtime.cpp:1408–1432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1406}
1407
1408void* NULLC::GetBasePointer(void* ptr)
1409{
1410 // Search in range of every pool
1411 if(void *base = pool8.GetBasePointer(ptr))
1412 return base;
1413 if(void *base = pool16.GetBasePointer(ptr))
1414 return base;
1415 if(void *base = pool32.GetBasePointer(ptr))
1416 return base;
1417 if(void *base = pool64.GetBasePointer(ptr))
1418 return base;
1419 if(void *base = pool128.GetBasePointer(ptr))
1420 return base;
1421 if(void *base = pool256.GetBasePointer(ptr))
1422 return base;
1423 if(void *base = pool512.GetBasePointer(ptr))
1424 return base;
1425 // Search in global pool
1426 for(unsigned int i = 0; i < globalObjects.size(); i++)
1427 {
1428 if(ptr >= globalObjects[i] && ptr <= (char*)globalObjects[i] + *(unsigned int*)globalObjects[i])
1429 return (char*)globalObjects[i] + 8;
1430 }
1431 return NULL;
1432}
1433
1434void NULLC::CollectMemory()
1435{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected