From 23bb3b26def55e5e5fde048fcbc2cfa43e20b1a3 Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Wed, 5 Mar 2025 21:22:47 +0330 Subject: Added a capacity checker to the array structure --- moonshine.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/moonshine.h b/moonshine.h index 59a9fa7..682a51e 100644 --- a/moonshine.h +++ b/moonshine.h @@ -1291,10 +1291,7 @@ const var *__new_array(const string type_name, const u8 type_size, const u8 coun return holder; } -// TODO: -// 1. Add a hidden capacity checker -// 2. Based on the capacity, detect whether we should or shouldn't reallocate the memory -// 3. eg. if an item is popped, we may keep that memory intact so that further allocations and memory copies will be unnecessary +// TODO: Add a demand level for the capacity checker, to modify the alignment amount the more the array increases in size. flatten void unsafe_extend( var *array_ref, -- cgit v1.2.3