array literals are now allowed in expressions; testing will be needed
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 17 Dec 2020 04:40:41 +0000 (22:40 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 17 Dec 2020 04:40:41 +0000 (22:40 -0600)
include/onyxastnodes.h
onyx
progs/odin_example.onyx
src/onyxclone.c
src/onyxparser.c
src/onyxsymres.c
src/onyxtypes.c
src/onyxutils.c
src/onyxwasm.c
tests/general1

index f46e4e89f02444d519fee6dc69ffb505a17b57a9..496890e0c1e4c201560cfb79688ebac69caec70e 100644 (file)
@@ -496,7 +496,13 @@ struct AstJump          { AstNode_base; JumpType jump; u32 count; };
 struct AstUse           { AstNode_base; AstTyped* expr; };
 
 // Structure Nodes
-struct AstBlock         { AstNode_base; AstNode *body; Scope *scope; bh_arr(AstLocal *) locals; };
+struct AstBlock         {
+    AstNode_base;
+    AstNode *body;
+    Scope *scope;
+
+    bh_arr(AstTyped *) allocate_exprs;
+};
 struct AstDefer         { AstNode_base; AstNode *stmt; };
 struct AstFor           {
     AstNode_base;
@@ -663,7 +669,7 @@ struct AstFunction {
     AstType* return_type;
 
     AstBlock *body;
-    bh_arr(AstLocal *) locals;
+    bh_arr(AstTyped *) allocate_exprs;
 
     // NOTE: used by the #add_overload directive. Initially set to a symbol,
     // then resolved to an overloaded function.
diff --git a/onyx b/onyx
index f393e5818bf72656635ede78b98fd7bf9177b703..adabd591f2cd54e4de49bf3bd92029a5c46ff051 100755 (executable)
Binary files a/onyx and b/onyx differ
index dcf5583a3c694fd596ff1007c0d2a23c2ffb94f9..3f89c1c61b9cffd124c9d9226dde17e949fd8f49 100644 (file)
@@ -56,7 +56,40 @@ make_bar :: proc () -> Bar {
     return bar;
 }
 
+f :: proc () -> [5] [2] u32 #export "IAMTHEFUNCTION" {
+    mem := cast(^u32) calloc(sizeof [5] [2] u32);
+    for i: 0 .. 10 do mem[i] = 1234 + i;
+    return ~~mem;
+
+
+    // This is safe ONLY when the value is used without calling another function.
+    // mem : [5] u32;
+    // for ^m: mem do *m = 4567;
+    // return mem;
+}
+
+compress :: proc (arr: [5] $T, f : proc (T, T) -> T) -> T {
+    val := arr[0];
+    for i: 1 .. 5 do val = f(val, arr[i]);
+    return val;
+}
+
 main :: proc (args: [] cstr) {
+    {
+        foo : [5] [2] u32;
+        foo = f();
+
+        printf("%p == %p\n", cast(^u32) foo, ^foo);
+        for ^thing: foo do for t: *thing do printf("%p %i\n", thing, t);
+
+        // This needs to be optimized
+        bar := u32.[ 1, 2, 3, 4, 5 ];
+        bar[2] = 1234;
+        for b: bar do printf("b: %i\n", b);
+
+        println(compress(f32.[ 1, 2, 3, 4, 5 ], proc (a: $T, b: T) -> T { return a + b; }));
+    }
+
     use package test { foo as foo_pkg }
     use package test as test
     use test.foo.SomeEnum
index e7ebfe2df3822271debd601047b73e39f3d61346..3cb73c2050e0364762c02532a6761e6533184599 100644 (file)
@@ -200,8 +200,8 @@ AstNode* ast_clone(bh_allocator a, void* n) {
 
                case Ast_Kind_Block:
                        ((AstBlock *) nn)->body = ast_clone_list(a, ((AstBlock *) node)->body);
-                       ((AstBlock *) nn)->locals = NULL;
-                       bh_arr_new(global_heap_allocator, ((AstBlock *) nn)->locals, 4);
+                       ((AstBlock *) nn)->allocate_exprs = NULL;
+                       bh_arr_new(global_heap_allocator, ((AstBlock *) nn)->allocate_exprs, 4);
                        break;
 
                case Ast_Kind_Defer:
@@ -334,8 +334,8 @@ AstNode* ast_clone(bh_allocator a, void* n) {
                        df->return_type = (AstType *) ast_clone(a, sf->return_type);
                        df->body = (AstBlock *) ast_clone(a, sf->body);
 
-                       df->locals = NULL;
-                   bh_arr_new(global_heap_allocator, df->locals, 4);
+                       df->allocate_exprs = NULL;
+                   bh_arr_new(global_heap_allocator, df->allocate_exprs, 4);
 
                        df->params = NULL;
                        bh_arr_new(global_heap_allocator, df->params, bh_arr_length(sf->params));
index 47052f15a0861f01a9b19704919bc77f5851893c..3edac59a64136a1c4edef942aaae0a24d9b22d52 100644 (file)
@@ -1282,7 +1282,7 @@ static AstNode* parse_statement(OnyxParser* parser) {
 // '{' <stmtlist> '}'
 static AstBlock* parse_block(OnyxParser* parser) {
     AstBlock* block = make_node(AstBlock, Ast_Kind_Block);
-    bh_arr_new(global_heap_allocator, block->locals, 4);
+    bh_arr_new(global_heap_allocator, block->allocate_exprs, 4);
 
     // NOTE: --- is for an empty block
     if (parser->curr->type == Token_Type_Empty_Block) {
@@ -1729,7 +1729,7 @@ static AstFunction* parse_function_definition(OnyxParser* parser) {
     AstFunction* func_def = make_node(AstFunction, Ast_Kind_Function);
     func_def->token = proc_token;
 
-    bh_arr_new(global_heap_allocator, func_def->locals, 4);
+    bh_arr_new(global_heap_allocator, func_def->allocate_exprs, 4);
     bh_arr_new(global_heap_allocator, func_def->params, 4);
 
     bh_arr(AstPolyParam) polymorphic_vars = NULL;
index 0624f8b7edbe547156c1cca34cbb9f1ca5313b1c..5a885f826dc90c93506a142581298dd78e5f56dd 100644 (file)
@@ -203,9 +203,9 @@ static void symres_local(AstLocal** local, b32 add_to_block_locals) {
     // of unique WASM locals and stack space needed.
     //                                            - brendanfh 2020/12/16
     if (add_to_block_locals)
-        bh_arr_push(bh_arr_last(semstate.block_stack)->locals, *local);
+        bh_arr_push(bh_arr_last(semstate.block_stack)->allocate_exprs, (AstTyped *) *local);
 
-    bh_arr_push(semstate.curr_function->locals, *local);
+    bh_arr_push(semstate.curr_function->allocate_exprs, (AstTyped *) *local);
 
     if ((*local)->token != NULL)
         symbol_introduce(semstate.curr_scope, (*local)->token, (AstNode *) *local);
@@ -378,6 +378,9 @@ static void symres_array_literal(AstArrayLiteral* al) {
 
     bh_arr_each(AstTyped *, expr, al->values)
         symres_expression(expr);
+
+    bh_arr_push(bh_arr_last(semstate.block_stack)->allocate_exprs, (AstTyped *) al);
+    bh_arr_push(semstate.curr_function->allocate_exprs, (AstTyped *) al);
 }
 
 static void symres_expression(AstTyped** expr) {
index dfe7a91cef3a41a03123400472945fed0c2ea4a7..01d59c54f4b98bc1d8547700b2759a6800e65b70 100644 (file)
@@ -735,8 +735,7 @@ b32 type_struct_is_simple(Type* type) {
 }
 
 b32 type_is_pointer(Type* type) {
-    return (type->kind == Type_Kind_Pointer)
-        || (type->kind == Type_Kind_Array);
+    return type->kind == Type_Kind_Pointer;
 }
 
 b32 type_is_rawptr(Type* type) {
@@ -798,6 +797,7 @@ b32 type_results_in_void(Type* type) {
 
 b32 type_is_array_accessible(Type* type) {
     if (type_is_pointer(type)) return 1;
+    if (type->kind == Type_Kind_Array) return 1;
     if (type->kind == Type_Kind_Slice) return 1;
     if (type->kind == Type_Kind_DynArray) return 1;
     if (type->kind == Type_Kind_VarArgs) return 1;
index fa62fc9f71caefbdc8ce32cc24b40bfef189bb7c..b1b3c51be5574fe7f3837a8b716df454ae26e982 100644 (file)
@@ -439,6 +439,17 @@ static Type* solve_poly_type(AstNode* target, AstType* type_expr, Type* actual)
                 break;
             }
 
+            case Ast_Kind_Array_Type: {
+                // TODO: Add check for same size array
+                if (elem.actual->kind != Type_Kind_Array) break;
+
+                bh_arr_push(elem_queue, ((PolySolveElem) {
+                    .type_expr = ((AstArrayType *) elem.type_expr)->elem,
+                    .actual = elem.actual->Array.elem,
+                }));
+                break;
+            }
+
             case Ast_Kind_Slice_Type: {
                 if (elem.actual->kind != Type_Kind_Slice) break;
 
index 55c8f59a4cd7c5ae031e5ea7e786091b3b8851f1..676926c0695b2fde939af952c5eb2a15fc0eda15 100644 (file)
@@ -256,8 +256,8 @@ static i32 get_element_idx(OnyxWasmModule* mod, AstFunction* func);
 #define LOCAL_F64  0x700000000
 #define LOCAL_V128 0xf00000000
 
-static b32 local_is_wasm_local(AstLocal* local) {
-    if (local->flags & Ast_Flag_Address_Taken) return 0;
+static b32 local_is_wasm_local(AstTyped* local) {
+    if (local->kind == Ast_Kind_Local && local->flags & Ast_Flag_Address_Taken) return 0;
     if (local->type->kind == Type_Kind_Basic) return 1;
     if (local->type->kind == Type_Kind_Enum && local->type->Enum.backing->kind == Type_Kind_Basic) return 1;
     if (local->type->kind == Type_Kind_Pointer) return 1;
@@ -303,7 +303,7 @@ static void local_raw_free(LocalAllocator* la, WasmType wt) {
     la->freed[idx]++;
 }
 
-static u64 local_allocate(LocalAllocator* la, AstLocal* local) {
+static u64 local_allocate(LocalAllocator* la, AstTyped* local) {
     if (local_is_wasm_local(local)) {
         WasmType wt = onyx_type_to_wasm_type(local->type);
         return local_raw_allocate(la, wt);
@@ -332,7 +332,7 @@ static u64 local_allocate(LocalAllocator* la, AstLocal* local) {
     }
 }
 
-static void local_free(LocalAllocator* la, AstLocal* local) {
+static void local_free(LocalAllocator* la, AstTyped* local) {
     if (local_is_wasm_local(local)) {
         WasmType wt = onyx_type_to_wasm_type(local->type);
         local_raw_free(la, wt);
@@ -390,6 +390,7 @@ EMIT_FUNC(struct_load,                   Type* type, u64 offset);
 EMIT_FUNC(struct_lval,                   AstTyped* lval);
 EMIT_FUNC(struct_store,                  Type* type, u64 offset);
 EMIT_FUNC(struct_literal,                AstStructLiteral* sl);
+EMIT_FUNC(array_literal,                 AstArrayLiteral* al);
 EMIT_FUNC(expression,                    AstTyped* expr);
 EMIT_FUNC(cast,                          AstUnaryOp* cast);
 EMIT_FUNC(return,                        AstReturn* ret);
@@ -410,8 +411,8 @@ EMIT_FUNC(block, AstBlock* block, b32 generate_block_headers) {
         WID(WI_BLOCK_START, 0x40);
     }
 
-    bh_arr_each(AstLocal *, local, block->locals)
-        bh_imap_put(&mod->local_map, (u64) *local, local_allocate(mod->local_alloc, *local));
+    bh_arr_each(AstTyped *, expr, block->allocate_exprs)
+        bh_imap_put(&mod->local_map, (u64) *expr, local_allocate(mod->local_alloc, *expr));
 
     forll (AstNode, stmt, block->body, next) {
         emit_statement(mod, &code, stmt);
@@ -419,8 +420,8 @@ EMIT_FUNC(block, AstBlock* block, b32 generate_block_headers) {
 
     emit_deferred_stmts(mod, &code, (AstNode *) block);
 
-    bh_arr_each(AstLocal *, local, block->locals)
-        local_free(mod->local_alloc, *local);
+    bh_arr_each(AstTyped *, expr, block->allocate_exprs)
+        local_free(mod->local_alloc, *expr);
 
     if (generate_block_headers) {
         WI(WI_BLOCK_END);
@@ -493,6 +494,51 @@ EMIT_FUNC(assignment, AstBinaryOp* assign) {
         return;
     }
 
+    if (assign->right->type->kind == Type_Kind_Array) {
+        Type* rtype = assign->right->type;
+
+        Type* elem_type = rtype;
+        u32 elem_count = 1;
+        while (elem_type->kind == Type_Kind_Array) {
+            elem_count *= elem_type->Array.count;
+            elem_type = elem_type->Array.elem;
+        }
+        u32 elem_size = type_size_of(elem_type);
+
+        u64 lptr_local = local_raw_allocate(mod->local_alloc, WASM_TYPE_INT32);
+        u64 rptr_local = local_raw_allocate(mod->local_alloc, WASM_TYPE_INT32);
+
+        emit_location(mod, &code, assign->left);
+        WIL(WI_LOCAL_SET, lptr_local);
+
+        emit_expression(mod, &code, assign->right);
+        WIL(WI_LOCAL_SET, rptr_local);
+
+        fori (i, 0, elem_count) {
+            if (!type_is_structlike(rtype))
+                WIL(WI_LOCAL_GET, lptr_local);
+
+            if (bh_arr_last(code).type == WI_LOCAL_SET && bh_arr_last(code).data.l == rptr_local)
+                bh_arr_last(code).type = WI_LOCAL_TEE;
+            else
+                WIL(WI_LOCAL_GET, rptr_local);
+            emit_load_instruction(mod, &code, elem_type, i * elem_size);
+
+            if (!type_is_structlike(rtype)) {
+                emit_store_instruction(mod, &code, elem_type, i * elem_size);
+            } else {
+                WIL(WI_LOCAL_GET, lptr_local);
+                emit_store_instruction(mod, &code, elem_type, i * elem_size);
+            }
+        }
+
+        local_raw_free(mod->local_alloc, WASM_TYPE_INT32);
+        local_raw_free(mod->local_alloc, WASM_TYPE_INT32);
+
+        *pcode = code;
+        return;
+    }
+
     AstTyped* lval = assign->left;
 
     if (lval->kind == Ast_Kind_Local) {
@@ -670,7 +716,7 @@ EMIT_FUNC(if, AstIfWhile* if_node) {
     bh_arr(WasmInstruction) code = *pcode;
 
     if (if_node->assignment != NULL) {
-        bh_imap_put(&mod->local_map, (u64) if_node->local, local_allocate(mod->local_alloc, if_node->local));
+        bh_imap_put(&mod->local_map, (u64) if_node->local, local_allocate(mod->local_alloc, (AstTyped *) if_node->local));
 
         emit_assignment(mod, &code, if_node->assignment);
     }
@@ -694,7 +740,7 @@ EMIT_FUNC(if, AstIfWhile* if_node) {
     bh_arr_pop(mod->structured_jump_target);
 
     if (if_node->assignment != NULL) {
-        local_free(mod->local_alloc, if_node->local);
+        local_free(mod->local_alloc, (AstTyped *) if_node->local);
     }
 
     WI(WI_IF_END);
@@ -706,7 +752,7 @@ EMIT_FUNC(while, AstIfWhile* while_node) {
     bh_arr(WasmInstruction) code = *pcode;
 
     if (while_node->assignment != NULL) {
-        bh_imap_put(&mod->local_map, (u64) while_node->local, local_allocate(mod->local_alloc, while_node->local));
+        bh_imap_put(&mod->local_map, (u64) while_node->local, local_allocate(mod->local_alloc, (AstTyped *) while_node->local));
 
         emit_assignment(mod, &code, while_node->assignment);
     }
@@ -755,7 +801,7 @@ EMIT_FUNC(while, AstIfWhile* while_node) {
     }
 
     if (while_node->assignment != NULL)
-        local_free(mod->local_alloc, while_node->local);
+        local_free(mod->local_alloc, (AstTyped *) while_node->local);
 
     *pcode = code;
 }
@@ -1048,7 +1094,7 @@ EMIT_FUNC(for, AstFor* for_node) {
     bh_arr(WasmInstruction) code = *pcode;
 
     AstLocal* var = for_node->var;
-    u64 iter_local = local_allocate(mod->local_alloc, var);
+    u64 iter_local = local_allocate(mod->local_alloc, (AstTyped *) var);
     bh_imap_put(&mod->local_map, (u64) var, iter_local);
 
     emit_expression(mod, &code, for_node->iter);
@@ -1069,7 +1115,7 @@ EMIT_FUNC(for, AstFor* for_node) {
         onyx_report_error(for_node->token->pos, "Invalid for loop type. You should probably not be seeing this...");
     }
 
-    local_free(mod->local_alloc, var);
+    local_free(mod->local_alloc, (AstTyped *) var);
 
     *pcode = code;
 }
@@ -1081,7 +1127,7 @@ EMIT_FUNC(switch, AstSwitch* switch_node) {
     bh_imap_init(&block_map, global_heap_allocator, bh_arr_length(switch_node->cases));
 
     if (switch_node->assignment != NULL) {
-        bh_imap_put(&mod->local_map, (u64) switch_node->local, local_allocate(mod->local_alloc, switch_node->local));
+        bh_imap_put(&mod->local_map, (u64) switch_node->local, local_allocate(mod->local_alloc, (AstTyped *) switch_node->local));
 
         emit_assignment(mod, &code, switch_node->assignment);
     }
@@ -1143,7 +1189,7 @@ EMIT_FUNC(switch, AstSwitch* switch_node) {
     bh_arr_pop(mod->structured_jump_target);
 
     if (switch_node->assignment != NULL)
-        local_free(mod->local_alloc, switch_node->local);
+        local_free(mod->local_alloc, (AstTyped *) switch_node->local);
 
     bh_imap_free(&block_map);
     *pcode = code;
@@ -2049,6 +2095,37 @@ EMIT_FUNC(struct_literal, AstStructLiteral* sl) {
     *pcode = code;
 }
 
+EMIT_FUNC(array_literal, AstArrayLiteral* al) {
+    bh_arr(WasmInstruction) code = *pcode;
+
+    u64 local_offset = (u64) bh_imap_get(&mod->local_map, (u64) al);
+    assert((local_offset & LOCAL_IS_WASM) == 0);
+
+    assert(al->type->kind == Type_Kind_Array);
+
+    u32 elem_size = type_size_of(al->type->Array.elem);
+
+    fori (i, 0, al->type->Array.count) {
+        if (!type_is_structlike(al->type->Array.elem))
+            WIL(WI_LOCAL_GET, mod->stack_base_idx);
+
+        emit_expression(mod, &code, al->values[i]);
+
+        if (!type_is_structlike(al->type->Array.elem)) {
+            emit_store_instruction(mod, &code, al->type->Array.elem, local_offset + i * elem_size);
+        } else {
+            WIL(WI_LOCAL_GET, mod->stack_base_idx);
+            emit_store_instruction(mod, &code, al->type->Array.elem, local_offset + i * elem_size);
+        }
+    }
+
+    WIL(WI_LOCAL_GET, mod->stack_base_idx);
+    WIL(WI_I32_CONST, local_offset);
+    WI(WI_I32_ADD);
+
+    *pcode = code;
+}
+
 EMIT_FUNC(location, AstTyped* expr) {
     bh_arr(WasmInstruction) code = *pcode;
 
@@ -2206,7 +2283,8 @@ EMIT_FUNC(expression, AstTyped* expr) {
         }
 
         case Ast_Kind_Array_Literal: {
-            assert(("Array literals are not allowed as expressions currently. This will be added in a future update.", 0));
+            // assert(("Array literals are not allowed as expressions currently. This will be added in a future update.", 0));
+            emit_array_literal(mod, &code, (AstArrayLiteral *) expr);
             break;
         }
 
@@ -2724,8 +2802,8 @@ static void emit_function(OnyxWasmModule* mod, AstFunction* fd) {
         assert(mod->curr_cc != CC_Undefined);
 
         mod->has_stack_locals = (mod->curr_cc == CC_Return_Stack);
-        bh_arr_each(AstLocal *, local, fd->locals)
-            mod->has_stack_locals |= !local_is_wasm_local(*local);
+        bh_arr_each(AstTyped *, expr, fd->allocate_exprs)
+            mod->has_stack_locals |= !local_is_wasm_local(*expr);
 
         if (mod->has_stack_locals) {
             // NOTE: '5' needs to match the number of instructions it takes
index 0c5e1cd1239295858a41a6c27be26e8f8546b3e1..c96ebb44b9b457e8756366d785ed7e25181b1b0b 100644 (file)
@@ -21,7 +21,7 @@ Evens from 6 to 34:
 Array details:
        Size: 0
        Capacity: 4
-       Data ptr: 0x10A28
+       Data ptr: 0x10A48
        Size of elements: 4
        Alignment of elements: 4
 
@@ -29,7 +29,7 @@ Array details:
 Array details:
        Size: 0
        Capacity: 4
-       Data ptr: 0x10A48
+       Data ptr: 0x10A68
        Size of elements: 8
        Alignment of elements: 8
 
@@ -37,8 +37,8 @@ Array details:
 0 5 10 15 20 4 9 14 19 3 8 13 18 2 7 12 17 1 6 11 16 0 5 10 15 20 4 9 14 19 3 8 13 18 2 7 12 17 1 6 11 16 0 5 10 15 20 4 9 14 19 3 8 13 18 2 7 12 17 1 6 11 16 0 5 10 15 20 4 9 14 19 3 8 13 18 2 7 12 17 1 6 11 16 0 5 10 15 20 4 9 14 19 3 8 13 18 2 7 12
 A has 22? false
 Vec3(0, 0, 0) Vec3(1, 1, 1) Vec3(2, 4, 8) Vec3(3, 9, 27) Vec3(4, 16, 64) Vec3(5, 25, 125) Vec3(6, 36, 216) Vec3(7, 49, 343) Vec3(8, 64, 512) Vec3(9, 81, 729) Vec3(10, 100, 1000) Vec3(11, 121, 1331) Vec3(12, 144, 1728) Vec3(13, 169, 2197) Vec3(14, 196, 2744) Vec3(15, 225, 3375) Vec3(16, 256, 4096) Vec3(17, 289, 4913) Vec3(18, 324, 5832) Vec3(19, 361, 6859) Vec3(20, 400, 8000) Vec3(21, 441, 9261) Vec3(22, 484, 10648) Vec3(23, 529, 12167) Vec3(24, 576, 13824) Vec3(25, 625, 15625) Vec3(26, 676, 17576) Vec3(27, 729, 19683) Vec3(28, 784, 21952) Vec3(29, 841, 24389) Vec3(30, 900, 27000) Vec3(31, 961, 29791) Vec3(32, 1024, 32768) Vec3(33, 1089, 35937) Vec3(34, 1156, 39304) Vec3(35, 1225, 42875) Vec3(36, 1296, 46656) Vec3(37, 1369, 50653) Vec3(38, 1444, 54872) Vec3(39, 1521, 59319) Vec3(40, 1600, 64000) Vec3(41, 1681, 68921) Vec3(42, 1764, 74088) Vec3(43, 1849, 79507) Vec3(44, 1936, 85184) Vec3(45, 2025, 91125) Vec3(46, 2116, 97336) Vec3(47, 2209, 103823) Vec3(48, 2304, 110592) Vec3(49, 2401, 117649) Vec3(50, 2500, 125000) Vec3(51, 2601, 132651) Vec3(52, 2704, 140608) Vec3(53, 2809, 148877) Vec3(54, 2916, 157464) Vec3(55, 3025, 166375) Vec3(56, 3136, 175616) Vec3(57, 3249, 185193) Vec3(58, 3364, 195112) Vec3(59, 3481, 205379) Vec3(60, 3600, 216000) Vec3(61, 3721, 226981) Vec3(62, 3844, 238328) Vec3(63, 3969, 250047) Vec3(64, 4096, 262144) Vec3(65, 4225, 274625) Vec3(66, 4356, 287496) Vec3(67, 4489, 300763) Vec3(68, 4624, 314432) Vec3(69, 4761, 328509) Vec3(70, 4900, 343000) Vec3(71, 5041, 357911) Vec3(72, 5184, 373248) Vec3(73, 5329, 389017) Vec3(74, 5476, 405224) Vec3(75, 5625, 421875) Vec3(76, 5776, 438976) Vec3(77, 5929, 456533) Vec3(78, 6084, 474552) Vec3(79, 6241, 493039) Vec3(80, 6400, 512000) Vec3(81, 6561, 531441) Vec3(82, 6724, 551368) Vec3(83, 6889, 571787) Vec3(84, 7056, 592704) Vec3(85, 7225, 614125) Vec3(86, 7396, 636056) Vec3(87, 7569, 658503) Vec3(88, 7744, 681472) Vec3(89, 7921, 704969) Vec3(90, 8100, 729000) Vec3(91, 8281, 753571) Vec3(92, 8464, 778688) Vec3(93, 8649, 804357) Vec3(94, 8836, 830584) Vec3(95, 9025, 857375) Vec3(96, 9216, 884736) Vec3(97, 9409, 912673) Vec3(98, 9604, 941192) Vec3(99, 9801, 970299) 
-0x11CD8 0x11CE4 0x11CF0 0x11CFC 0x11D08 0x11D14 0x11D20 0x11D2C 0x11D38 0x11D44 0x11D50 0x11D5C 0x11D68 0x11D74 0x11D80 0x11D8C 0x11D98 0x11DA4 0x11DB0 0x11DBC 0x11DC8 0x11DD4 0x11DE0 0x11DEC 0x11DF8 0x11E04 0x11E10 0x11E1C 0x11E28 0x11E34 0x11E40 0x11E4C 0x11E58 0x11E64 0x11E70 0x11E7C 0x11E88 0x11E94 0x11EA0 0x11EAC 0x11EB8 0x11EC4 0x11ED0 0x11EDC 0x11EE8 0x11EF4 0x11F00 0x11F0C 0x11F18 0x11F24 0x11F30 0x11F3C 0x11F48 0x11F54 0x11F60 0x11F6C 0x11F78 0x11F84 0x11F90 0x11F9C 0x11FA8 0x11FB4 0x11FC0 0x11FCC 0x11FD8 0x11FE4 0x11FF0 0x11FFC 0x12008 0x12014 0x12020 0x1202C 0x12038 0x12044 0x12050 0x1205C 0x12068 0x12074 0x12080 0x1208C 0x12098 0x120A4 0x120B0 0x120BC 0x120C8 0x120D4 0x120E0 0x120EC 0x120F8 0x12104 0x12110 0x1211C 0x12128 0x12134 0x12140 0x1214C 0x12158 0x12164 0x12170 0x1217
-1838 1842 1846 1850 1854 1858 1862 1866 1870 1874 1878 1882 
+0x11CF8 0x11D04 0x11D10 0x11D1C 0x11D28 0x11D34 0x11D40 0x11D4C 0x11D58 0x11D64 0x11D70 0x11D7C 0x11D88 0x11D94 0x11DA0 0x11DAC 0x11DB8 0x11DC4 0x11DD0 0x11DDC 0x11DE8 0x11DF4 0x11E00 0x11E0C 0x11E18 0x11E24 0x11E30 0x11E3C 0x11E48 0x11E54 0x11E60 0x11E6C 0x11E78 0x11E84 0x11E90 0x11E9C 0x11EA8 0x11EB4 0x11EC0 0x11ECC 0x11ED8 0x11EE4 0x11EF0 0x11EFC 0x11F08 0x11F14 0x11F20 0x11F2C 0x11F38 0x11F44 0x11F50 0x11F5C 0x11F68 0x11F74 0x11F80 0x11F8C 0x11F98 0x11FA4 0x11FB0 0x11FBC 0x11FC8 0x11FD4 0x11FE0 0x11FEC 0x11FF8 0x12004 0x12010 0x1201C 0x12028 0x12034 0x12040 0x1204C 0x12058 0x12064 0x12070 0x1207C 0x12088 0x12094 0x120A0 0x120AC 0x120B8 0x120C4 0x120D0 0x120DC 0x120E8 0x120F4 0x12100 0x1210C 0x12118 0x12124 0x12130 0x1213C 0x12148 0x12154 0x12160 0x1216C 0x12178 0x12184 0x12190 0x1219
+1870 1874 1878 1882 1886 1890 1894 1898 1902 1906 1910 1914 
 20 20 20 20 20 19 19 19 19 19 18 18 18 18 18 17 17 17 17 16 16 16 16 15 15 15 15 15 14 14 14 14 14 13 13 13 13 13 12 12 12 12 12 11 11 11 11 10 10 10 10 10 9 9 9 9 9 8 8 8 8 8 7 7 7 7 7 6 6 6 6 5 5 5 5 5 4 4 4 4 4 3 3 3 3 3 2 2 2 2 2 1 1 1 1 0 0 0 0 0
 297 294 291 288 285 282 279 276 273 270 267 264 261 258 255 252 249 246 243 240 237 234 231 228 225 222 219 216 213 210 207 204 201 198 195 192 189 186 183 180 177 174 171 168 165 162 159 156 153 150 147 144 141 138 135 132 129 126 123 120 117 114 111 108 105 102 99 96 93 90 87 84 81 78 75 72 69 66 63 60 57 54 51 48 45 42 39 36 33 30 27 24 21 18 15 12 9 6 3 0
 After adding...
@@ -46,7 +46,7 @@ After adding...
 Array details:
        Size: 100
        Capacity: 128
-       Data ptr: 0x116B8
+       Data ptr: 0x116D8
        Size of elements: 4
        Alignment of elements: 4
 
@@ -54,7 +54,7 @@ Array details:
 Array details:
        Size: 100
        Capacity: 128
-       Data ptr: 0x118C8
+       Data ptr: 0x118E8
        Size of elements: 8
        Alignment of elements: 8
 
@@ -62,7 +62,7 @@ Array A sum: 999
 
 Has ^a[20]? true
 Has null? false
-Value at ^a[50]: 0x11A58 == 0x11A58
+Value at ^a[50]: 0x11A78 == 0x11A78
 Deleteing ^a[20]
 Has ^a[20]? false
 Clearing SOA...