From 3c53293e9b2c2f9106da805d26b5eab9dff56225 Mon Sep 17 00:00:00 2001 From: A404M Date: Sat, 31 May 2025 06:26:48 +0330 Subject: function with exact types are prefered to shape shifters --- code/lib/memory.felan | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'code/lib/memory.felan') 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)); +}; -- cgit v1.2.3