MCPcopy Create free account
hub / github.com/DFHack/dfhack / dealloc

Function dealloc

depends/sizecheck/sizecheck.cpp:55–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void dealloc(void* addr) {
56 if (!initialized) {
57 init();
58 }
59 if (uintptr_t(addr) % 32 == 16 && *(uint32_t*)((uint8_t*)addr - 8) == MAGIC) {
60 addr = (void*)((uint8_t*)addr - 16);
61 memset((uint8_t*)addr + 16, perturb & 0xff, *(size_t*)addr);
62 }
63 free(addr);
64}
65
66void* operator new (size_t n, const nothrow_t& tag) {
67 return alloc(n);

Callers 1

operator deleteFunction · 0.85

Calls 1

initFunction · 0.70

Tested by

no test coverage detected