No description
| README.md | ||
| sump.odin | ||
Sump is a thin reusable Odin wrapper around setting up a tracking allocator and reporting leaks.
The intended use is like so:
import "sump"
main :: proc() {
when ODIN_DEBUG {
context.allocator = sump.start()
defer sump.end()
}
// do your stuff here
}
In the example above, when compiled as a debug build sump.start() will setup and return a tracking allocator, using the default allocator as the backing allocator. On program exit, sump.end() will check the tracking allocator's stats and report (on STDERR) any leaks with file, line number, and how many bytes were leaked.