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

Method IsBasePointer

NULLC/translation/runtime.cpp:1165–1178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163 freeBlocks = freedBlock;
1164 }
1165 bool IsBasePointer(void* ptr)
1166 {
1167 MyLargeBlock *curr = activePages;
1168 while(curr)
1169 {
1170 if((char*)ptr >= (char*)curr->page && (char*)ptr <= (char*)curr->page + sizeof(MyLargeBlock))
1171 {
1172 if(((unsigned int)(intptr_t)((char*)ptr - (char*)curr->page) & (elemSize - 1)) == 4)
1173 return true;
1174 }
1175 curr = curr->next;
1176 }
1177 return false;
1178 }
1179 void* GetBasePointer(void* ptr)
1180 {
1181 if(!sortedPages.size() || ptr < sortedPages[0] || ptr > (char*)sortedPages.back() + sizeof(MyLargeBlock))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected