|
@@ -12,22 +12,22 @@ import "core:mem"
|
|
|
import "core:fmt"
|
|
|
|
|
|
_main :: proc() {
|
|
|
- do stuff
|
|
|
+ do stuff
|
|
|
}
|
|
|
|
|
|
main :: proc() {
|
|
|
- track: mem.Tracking_Allocator
|
|
|
- mem.tracking_allocator_init(&track, context.allocator)
|
|
|
- context.allocator = mem.tracking_allocator(&track)
|
|
|
-
|
|
|
- _main()
|
|
|
-
|
|
|
- for _, v in track.allocation_map {
|
|
|
- fmt.printf("%v leaked %v bytes", v.location, v.size)
|
|
|
- }
|
|
|
- for bf in track.bad_free_array {
|
|
|
- fmt.printf("%v allocation %p was freed badly", bf.location, bf.memory)
|
|
|
- }
|
|
|
+ track: mem.Tracking_Allocator
|
|
|
+ mem.tracking_allocator_init(&track, context.allocator)
|
|
|
+ context.allocator = mem.tracking_allocator(&track)
|
|
|
+
|
|
|
+ _main()
|
|
|
+
|
|
|
+ for _, leak in track.allocation_map {
|
|
|
+ fmt.printf("%v leaked %v bytes\n", leak.location, leak.size)
|
|
|
+ }
|
|
|
+ for bad_free in track.bad_free_array {
|
|
|
+ fmt.printf("%v allocation %p was freed badly\n", bad_free.location, bad_free.memory)
|
|
|
+ }
|
|
|
}
|
|
|
```
|
|
|
*/
|