Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core/heap.disabled: remove tracking of allocations
We used to keep track of allocated pointers to warn about them if the heap was destroyed without all pointers being freed first. However, this means we keep a list of pointers around until the heap is destroyed, which for certain heaps may never happen; this will cause tools such as Valgrind or LeakSanitizer to (correctly) see a valid pointer remaining to the allocated memory and thus not detect a leak, even if any actual *useful* pointers were lost. These tools are more general and can also provide backtraces indicating where the leaked memory was allocated, hence are strictly superior to the check we did in mowgli_heap_destroy. Removing the remaining bookkeeping allows them to work on mowgli_heap-allocated memory. This essentially turns mowgli_heap_t and the related functions into a wrapper around the configured allocate/deallocate functions except always passing a fixed size. Since this is the code used when users specifically requested to build without the heap allocator, that seems like it shouldn't violate any assumptions.
- Loading branch information