Kym Object Allocation Fix #13

Merged
kayomn merged 3 commits from kym-object-alloc-fix into main 2023-06-03 22:07:19 +02:00
Owner

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.

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.
kayomn added this to the (deleted) milestone 2023-06-03 21:57:49 +02:00
kayomn added the
bug
label 2023-06-03 21:57:49 +02:00
kayomn self-assigned this 2023-06-03 21:57:49 +02:00
kayomn added 2 commits 2023-06-03 21:57:50 +02:00
Implement slab map data structure
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
713f9bb08c
kayomn reviewed 2023-06-03 22:03:38 +02:00
@ -8,0 +7,4 @@
const std = @import("std");
///
/// Addressable mapping of integer values of type described by `index_int` to values of type `Value`.
Author
Owner

Overly wordy comment

Overly wordy comment
kayomn marked this conversation as resolved
@ -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
Author
Owner

Comment could do with clarification.

Comment could do with clarification.
kayomn marked this conversation as resolved
@ -17,0 +37,4 @@
const Index = math.Int(index_int);
///
/// Slab type.
Author
Owner

Slab map type.

Slab *map* type.
kayomn marked this conversation as resolved
@ -29,0 +77,4 @@
io.deallocate(allocator, self.table);
self.table = &.{};
self.count = 0;
Author
Owner

free_index should be reset in here as well, otherwise re-uses of the data structure in future will have a corrupt initial state.

`free_index` should be reset in here as well, otherwise re-uses of the data structure in future will have a corrupt initial state.
kayomn marked this conversation as resolved
kayomn added 1 commit 2023-06-03 22:05:52 +02:00
Amend code review comments
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
d8077d782d
kayomn merged commit 9eadd30aa5 into main 2023-06-03 22:07:19 +02:00
kayomn deleted branch kym-object-alloc-fix 2023-06-03 22:07:20 +02:00
Sign in to join this conversation.
No description provided.