aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-16 12:02:23 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-16 12:02:23 +0000
commit3811ff53a60cc6e7277e5de98e696a9a76c36a9e (patch)
treecfb0da4caac5d843a3d9c9d03d5ab2a9ccd12839 /runtime
parentb59c72a2a7f0f128b38f48d50e37630cc90dfe20 (diff)
Extract alloc.{h,c}
Diffstat (limited to 'runtime')
-rw-r--r--runtime/meson.build2
-rw-r--r--runtime/src/alloc.c (renamed from runtime/src/shed.c)12
-rw-r--r--runtime/src/alloc.h8
3 files changed, 14 insertions, 8 deletions
diff --git a/runtime/meson.build b/runtime/meson.build
index 03ad07de..5c679a54 100644
--- a/runtime/meson.build
+++ b/runtime/meson.build
@@ -2,10 +2,10 @@ project('shed-runtime', 'c', default_options : ['warning_level=1'])
static_library(
'shed',
'src/patio/exceptions.c',
+ 'src/alloc.c',
'src/effects.c',
'src/ints.c',
'src/primitives.c',
- 'src/shed.c',
'src/strings.c',
'src/namespaces/Shed/Builtins.c',
)
diff --git a/runtime/src/shed.c b/runtime/src/alloc.c
index 05e5dd9b..f7972fbf 100644
--- a/runtime/src/shed.c
+++ b/runtime/src/alloc.c
@@ -1,15 +1,13 @@
-#include <stdint.h>
-
-#ifndef __WASM__
-#include <stdlib.h>
-#endif
-
-#include "./shed.h"
+#include "./std/unistd.h"
#ifdef __WASM__
void* malloc(unsigned long);
+#else
+
+#include <stdlib.h>
+
#endif
void* shed__runtime__alloc(size_t size) {
diff --git a/runtime/src/alloc.h b/runtime/src/alloc.h
new file mode 100644
index 00000000..b0a4e1cd
--- /dev/null
+++ b/runtime/src/alloc.h
@@ -0,0 +1,8 @@
+#ifndef SHED_ALLOC_H
+#define SHED_ALLOC_H
+
+#include "./std/unistd.h"
+
+void* shed__runtime__alloc(size_t size);
+
+#endif