diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-31 06:26:48 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-31 06:26:48 +0330 |
commit | 3c53293e9b2c2f9106da805d26b5eab9dff56225 (patch) | |
tree | d88cff685789812698e16711bb61e35e2918b110 /code/lib/memory.felan | |
parent | faf462fe49bf642866175d842a98d721f8f66208 (diff) |
function with exact types are prefered to shape shifters
Diffstat (limited to 'code/lib/memory.felan')
-rw-r--r-- | code/lib/memory.felan | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/code/lib/memory.felan b/code/lib/memory.felan index adb9cf2..f1f9898 100644 --- a/code/lib/memory.felan +++ b/code/lib/memory.felan @@ -5,3 +5,7 @@ free :: @c_function(libc,"free",(*void)->void); malloc :: (size:i64,comptime t:type) -> (*t) { return @cast(malloc(size*@cast(@size_of(t),i64)),*t); }; + +free :: (a:*anytype) -> void { + free(@cast(a,*void)); +}; |