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

Method IsBasePointer

NULLC/StdLib.cpp:133–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 freeBlocks = freedBlock;
132 }
133 bool IsBasePointer(void* ptr)
134 {
135 MyLargeBlock *curr = activePages;
136 while(curr)
137 {
138 if((char*)ptr >= (char*)curr->page && (char*)ptr <= (char*)curr->page + sizeof(MyLargeBlock))
139 {
140 if(((unsigned int)(intptr_t)((char*)ptr - (char*)curr->page) & (elemSize - 1)) == sizeof(markerType))
141 return true;
142 }
143 curr = curr->next;
144 }
145 return false;
146 }
147 void* GetBasePointer(void* ptr)
148 {
149 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