Colorized and table formatted memory tracker for debugging Odin programs. Full credit to Odin (gingerbill) and Karl Zylinski for the original version of the non-formatted version.
This package depends on afmt package.
Create folder "tracker" in the "odin/shared" folder
copy tracker.odin to the "tracker" folder
Add to your project
import "shared:tracker"
Copy to the top of main:
when ODIN_DEBUG {
t := tracker.init_tracker()
context.allocator = tracker.tracking_allocator(&t)
defer tracker.print_and_destroy_tracker(&t)
}
Build with:
odin build . -debug
By default, the tracker will panic on bad frees. To override this use:
odin build . -debug -define:panic=false