diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -53,3 +53,19 @@ are allocated on demand when the current one is full. LARGE allocations each get their own `mmap` region and are released individually via `munmap`. All returned pointers are 16-byte aligned. + +## Testing + +AddressSanitizer (ASan) cannot be used to test this allocator. ASan intercepts +`malloc`/`free` itself and expects specific allocator metadata (redzones, +quarantine zones) that a custom allocator does not provide. The two +implementations would conflict. Since allocations go through `mmap`, they also +bypass ASan's shadow memory tracking entirely. + +Alternatives for catching bugs: +- **Valgrind** — operates at the binary level without replacing `malloc`, so it + can detect issues in the allocator's own internal logic. +- **Custom tests** — targeted checks for write-after-free, double free, boundary + writes, and stress scenarios. +- **`show_alloc_mem()`** — inspect zone and chunk state visually after + operations. |
