| 53 | } |
| 54 | |
| 55 | void 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 | |
| 66 | void* operator new (size_t n, const nothrow_t& tag) { |
| 67 | return alloc(n); |
no test coverage detected