Kym Object Allocation Fix #13
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#13
Loading…
Reference in New Issue
No description provided.
Delete Branch "kym-object-alloc-fix"
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?
Provides a missing implementation to the slab map data structure type, updates the interface to be more safe, and modifies existing consumers of said API to fix object allocation always failing within the Kym scripting engine.
@ -8,0 +7,4 @@
const std = @import("std");
///
/// Addressable mapping of integer values of type described by `index_int` to values of type `Value`.
Overly wordy comment
@ -8,0 +10,4 @@
/// Addressable mapping of integer values of type described by `index_int` to values of type `Value`.
///
/// Slab maps are similar to slot maps in that they have O(1) insertion and removal, use a fragmented flat table
/// structure instead. This reduces memory usage in some cases and can be useful for data that does not need to be
Comment could do with clarification.
@ -17,0 +37,4 @@
const Index = math.Int(index_int);
///
/// Slab type.
Slab map type.
@ -29,0 +77,4 @@
io.deallocate(allocator, self.table);
self.table = &.{};
self.count = 0;
free_index
should be reset in here as well, otherwise re-uses of the data structure in future will have a corrupt initial state.