Add Leak Detection to Ona Heap Allocator #15

Merged
kayomn merged 12 commits from ona-allocator-safety-tracker into main 2023-06-04 16:07:47 +02:00
Owner

Closes #12.

Also fixed a few undetected leaks and incorrect size signings on allocations in the process of implementing this.

Closes #12. Also fixed a few undetected leaks and incorrect size signings on allocations in the process of implementing this.
kayomn added this to the (deleted) milestone 2023-06-04 03:18:54 +02:00
kayomn added the
bug
label 2023-06-04 03:18:54 +02:00
kayomn self-assigned this 2023-06-04 03:18:54 +02:00
kayomn added 1 commit 2023-06-04 03:18:55 +02:00
Add leak detection to Ona heap allocator
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
306e085d1b
kayomn added 5 commits 2023-06-04 05:08:26 +02:00
kayomn added 4 commits 2023-06-04 15:44:32 +02:00
kayomn changed title from WIP: Add Leak Detection to Ona Heap Allocator to Add Leak Detection to Ona Heap Allocator 2023-06-04 15:49:09 +02:00
kayomn reviewed 2023-06-04 15:53:59 +02:00
@ -188,0 +176,4 @@
var interned_iterable = InternTable.Iterable{.hashed_map = &self.interned};
while (interned_iterable.next()) |entry| {
self.discard(.{.object = entry.value});
Author
Owner

Perhaps discard could have an internal complimentary function specifically for discarding objects to save on the effort of wrapping a known type in a discriminated union only to unwrap it again back to the known type.

Perhaps `discard` could have an internal complimentary function specifically for discarding objects to save on the effort of wrapping a known type in a discriminated union only to unwrap it again back to the known type.
kayomn marked this conversation as resolved
@ -188,2 +183,4 @@
self.interned.deinit(self.allocator);
self.values.deinit(self.allocator);
self.calls.deinit(self.allocator);
self.heap.deinit(self.allocator);
Author
Owner

May be worth adding an assert to check that the VM environment heap is empty by now before calling deinit.

May be worth adding an assert to check that the VM environment heap is empty by now before calling deinit.
kayomn marked this conversation as resolved
kayomn added 2 commits 2023-06-04 16:06:34 +02:00
Amend code review comments
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
3794259949
kayomn merged commit 7714dae4d8 into main 2023-06-04 16:07:47 +02:00
kayomn deleted branch ona-allocator-safety-tracker 2023-06-04 16:07:47 +02:00
Sign in to join this conversation.
No description provided.