diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-30 19:57:25 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-30 19:57:25 +0330 |
commit | bb3822cbb347c712925530ded451fc9027f3b26f (patch) | |
tree | 19e3d3fdb99aa61f331346eeb559e5a625e94b7a /code/main.felan | |
parent | 1f529259c67dad4828908d502f40cb71d0345c56 (diff) |
add more memory management stuff
Diffstat (limited to 'code/main.felan')
-rw-r--r-- | code/main.felan | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/code/main.felan b/code/main.felan index d14013e..c17b965 100644 --- a/code/main.felan +++ b/code/main.felan @@ -1,4 +1,5 @@ @import("basic.felan"); +@import("lib/memory.felan"); print :: (value:**anytype)->void{ if comptime @type_of(value.*) == u8 { @@ -29,12 +30,13 @@ __get_item_address__ :: (left:*anytype,index:i64,item:@type_of(left.*)) -> (@typ }; main :: ()->void{ - p := @stack_alloc(i64,10); + p := malloc(10,u64); i := 0; while i < 10 { __set_item__(p,i,0); i += 1; } print(__get_item__(p,1)); + free(@cast(p,*void)); }; |