We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running this example https://github.com/laytan/odin-http/blob/main/examples/client/main.odin
with
main :: proc() { track(run) } run :: proc() { // example code } track :: proc(code: proc()) { track: mem.Tracking_Allocator mem.tracking_allocator_init(&track, context.allocator) context.allocator = mem.tracking_allocator(&track) defer { if len(track.allocation_map) > 0 { fmt.eprintf("=== %v allocations not freed: ===\n", len(track.allocation_map)) for _, entry in track.allocation_map { fmt.eprintf("- %v bytes @ %v\n", entry.size, entry.location) } } if len(track.bad_free_array) > 0 { fmt.eprintf("=== %v incorrect frees: ===\n", len(track.bad_free_array)) for entry in track.bad_free_array { fmt.eprintf("- %p @ %v\n", entry.memory, entry.location) } } fmt.printf("Peak memory allocated: %v\n", track.peak_memory_allocated) mem.tracking_allocator_destroy(&track) } code() }
results in
=== 5 allocations not freed: === - 108 bytes @ /Users/vitaly/projects/odin-http/http.odin:165:11: - 11 bytes @ /Users/vitaly/projects/odin-http/headers.odin:100:7: - 161 bytes @ /Users/vitaly/projects/odin-http/http.odin:165:11: - 11 bytes @ /Users/vitaly/projects/odin-http/headers.odin:100:7: - 311 bytes @ /Users/vitaly/projects/odin-http/http.odin:165:11:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Running this example https://github.com/laytan/odin-http/blob/main/examples/client/main.odin
with
results in
The text was updated successfully, but these errors were encountered: