change the built in slots to be allocated on the fly, making the objects smaller but faster

This commit is contained in:
William Bell
2025-09-09 17:55:54 +01:00
parent fc7cfc7cfb
commit 774890de1d
5 changed files with 69 additions and 27 deletions

View File

@@ -98,12 +98,19 @@ struct argon_function_struct {
uint64_t column;
};
struct built_in_slot {
built_in_fields field;
ArgonObject*value;
};
// full definition of ArgonObject (no typedef again!)
struct ArgonObject {
ArgonType type;
ArgonType child_type;
struct hashmap_GC *dict;
ArgonObject* Builtin_slots[BUILT_IN_FIELDS_COUNT];
struct built_in_slot* built_in_slot;
size_t built_in_slot_size;
size_t built_in_slot_length;
bool as_bool;
union {
struct as_number {