Add Leak Detection to Ona Heap Allocator #15
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kayomn/ona#15
Loading…
Reference in New Issue
No description provided.
Delete Branch "ona-allocator-safety-tracker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #12.
Also fixed a few undetected leaks and incorrect size signings on allocations in the process of implementing this.
WIP: Add Leak Detection to Ona Heap Allocatorto Add Leak Detection to Ona Heap Allocator@ -188,0 +176,4 @@
var interned_iterable = InternTable.Iterable{.hashed_map = &self.interned};
while (interned_iterable.next()) |entry| {
self.discard(.{.object = entry.value});
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.@ -188,2 +183,4 @@
self.interned.deinit(self.allocator);
self.values.deinit(self.allocator);
self.calls.deinit(self.allocator);
self.heap.deinit(self.allocator);
May be worth adding an assert to check that the VM environment heap is empty by now before calling deinit.