blob: 55451c5e166586f86f960ba5447cca87c8b73a5a (
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 :: (ptr:*anytype) -> void {
free(@cast(ptr,*void));
};
|