mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
fix whitespace
This commit is contained in:
+5
-5
@@ -7,22 +7,22 @@ in your program and report leaks and bad frees:
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
import "core:mem"
|
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)
|
||||||
defer mem.tracking_allocator_destroy(&track)
|
defer mem.tracking_allocator_destroy(&track)
|
||||||
context.allocator = mem.tracking_allocator(&track)
|
context.allocator = mem.tracking_allocator(&track)
|
||||||
|
|
||||||
_main()
|
_main()
|
||||||
|
|
||||||
for _, leak in track.allocation_map {
|
for _, leak in track.allocation_map {
|
||||||
fmt.printf("%v leaked %m\n", leak.location, leak.size)
|
fmt.printf("%v leaked %m\n", leak.location, leak.size)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user