MCPcopy Create free account
hub / github.com/beefytech/Beef / DbgHeapHashMemory

Function DbgHeapHashMemory

BeefySysLib/util/AllocDebug.cpp:271–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269#define ALLOC_MAGIC 0xBF
270
271static int DbgHeapHashMemory(void* ptr, int size)
272{
273 int curHash = 0;
274 uint8_t* curHashPtr = (uint8_t*) ptr;
275 for (int i = 0; i < size; i++)
276 {
277 curHash = ((curHash ^ *curHashPtr) << 5) - curHash;
278 curHashPtr++;
279 }
280 return curHash;
281}
282
283static void* DbgHeapAlloc(std::size_t size, const char* fileName, int lineNum)
284{

Callers 2

DbgHeapFreeFunction · 0.85
DbgHeapCheckFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected