summaryrefslogtreecommitdiff
path: root/std/mem.toc
diff options
context:
space:
mode:
Diffstat (limited to 'std/mem.toc')
-rw-r--r--std/mem.toc6
1 files changed, 4 insertions, 2 deletions
diff --git a/std/mem.toc b/std/mem.toc
index 6d16895..e283364 100644
--- a/std/mem.toc
+++ b/std/mem.toc
@@ -1,6 +1,8 @@
+#include "std/base.toc";
+
// TODO: check for failed calloc
-calloc ::= #foreign("calloc", "libc.so.6") fn(#C size_t, #C size_t) #C &"void";
-free ::= #foreign("free", "libc.so.6") fn(#C &"void");
+calloc ::= #foreign("calloc", libc) fn(#C size_t, #C size_t) #C &"void";
+free ::= #foreign("free", libc) fn(#C &"void");
new ::= fn(t :: Type) &t {
calloc(1, (sizeof t) as #C size_t)