aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Moon Flower <moon@coffin.ir> 2025-03-05 21:22:47 +0330
committerGravatar Moon Flower <moon@coffin.ir> 2025-03-05 21:22:47 +0330
commit23bb3b26def55e5e5fde048fcbc2cfa43e20b1a3 (patch)
treee291e5f74a6694163082fd67afc71aaa5b77477e
parentAdded a capacity checker to the array structure (diff)
Added a capacity checker to the array structure
-rw-r--r--moonshine.h5
1 files changed, 1 insertions, 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,