mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-25 07:04:58 -07:00
[mem] Add missing \n to tracking allocator example.
This commit is contained in:
+11
-11
@@ -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)
|
||||
track: mem.Tracking_Allocator
|
||||
mem.tracking_allocator_init(&track, context.allocator)
|
||||
context.allocator = mem.tracking_allocator(&track)
|
||||
|
||||
_main()
|
||||
_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)
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
```
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user