mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00: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"
|
import "core:fmt"
|
||||||
|
|
||||||
_main :: proc() {
|
_main :: proc() {
|
||||||
do stuff
|
do stuff
|
||||||
}
|
}
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
track: mem.Tracking_Allocator
|
track: mem.Tracking_Allocator
|
||||||
mem.tracking_allocator_init(&track, context.allocator)
|
mem.tracking_allocator_init(&track, context.allocator)
|
||||||
context.allocator = mem.tracking_allocator(&track)
|
context.allocator = mem.tracking_allocator(&track)
|
||||||
|
|
||||||
_main()
|
_main()
|
||||||
|
|
||||||
for _, v in track.allocation_map {
|
for _, leak in track.allocation_map {
|
||||||
fmt.printf("%v leaked %v bytes", v.location, v.size)
|
fmt.printf("%v leaked %v bytes\n", leak.location, leak.size)
|
||||||
}
|
}
|
||||||
for bf in track.bad_free_array {
|
for bad_free in track.bad_free_array {
|
||||||
fmt.printf("%v allocation %p was freed badly", bf.location, bf.memory)
|
fmt.printf("%v allocation %p was freed badly\n", bad_free.location, bad_free.memory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user