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
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
306e085d1b
Add leak detection to Ona heap allocator
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
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
3794259949
Amend code review comments
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 reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kayomn/ona#15
No description provided.