blob: 7715d0e1d57a6470cf4129e13026a3e570a758d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
@import("operator.felan");
libc :: @c_library("/usr/lib/libc.so.6");
malloc :: @c_function(libc,"malloc",(i64)->(*void));
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));
};
|