25 lines
549 B
Odin
25 lines
549 B
Odin
package main
|
|
|
|
import game "./game"
|
|
import "core:fmt"
|
|
import "core:mem"
|
|
|
|
|
|
main :: proc() {
|
|
track: mem.Tracking_Allocator
|
|
mem.tracking_allocator_init(&track, context.allocator)
|
|
defer mem.tracking_allocator_destroy(&track)
|
|
context.allocator = mem.tracking_allocator(&track)
|
|
|
|
game.run()
|
|
|
|
// Report at exit
|
|
fmt.printf("peak heap: %d bytes\n", track.peak_memory_allocated)
|
|
fmt.printf("still live: %d bytes\n", track.current_memory_allocated)
|
|
|
|
for _, leak in track.allocation_map {
|
|
fmt.printf("leak at %v: %m\n", leak.location, leak.size)
|
|
}
|
|
}
|
|
|