From 35b923b9f820653525a033f8ab2006ba1cb8c65c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 19 Mar 2024 16:09:59 +0000 Subject: Remove shed__runtime__alloc() --- runtime/src/shed/alloc.c | 6 ------ runtime/src/shed/alloc.h | 19 ------------------- runtime/src/shed/gc/mark-and-sweep/gc.c | 2 +- runtime/src/shed/std/malloc.h | 15 +++++++++++++++ 4 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 runtime/src/shed/alloc.c delete mode 100644 runtime/src/shed/alloc.h create mode 100644 runtime/src/shed/std/malloc.h (limited to 'runtime/src') diff --git a/runtime/src/shed/alloc.c b/runtime/src/shed/alloc.c deleted file mode 100644 index f68fb128..00000000 --- a/runtime/src/shed/alloc.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "./std/unistd.h" -#include "./alloc.h" - -void* shed__runtime__alloc(size_t size) { - return malloc(size); -} diff --git a/runtime/src/shed/alloc.h b/runtime/src/shed/alloc.h deleted file mode 100644 index 07a14436..00000000 --- a/runtime/src/shed/alloc.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SHED_ALLOC_H -#define SHED_ALLOC_H - -#include "./std/unistd.h" - -#ifdef __wasm__ - -void* malloc(unsigned long); -void free(void*); - -#else - -#include - -#endif - -void* shed__runtime__alloc(size_t size); - -#endif diff --git a/runtime/src/shed/gc/mark-and-sweep/gc.c b/runtime/src/shed/gc/mark-and-sweep/gc.c index e874157a..e6cbc0fa 100644 --- a/runtime/src/shed/gc/mark-and-sweep/gc.c +++ b/runtime/src/shed/gc/mark-and-sweep/gc.c @@ -1,9 +1,9 @@ #include #include "../../../patio/patio.h" -#include "../../alloc.h" #include "../../gc.h" #include "../../primitives.h" +#include "../../std/malloc.h" // == GC objects == diff --git a/runtime/src/shed/std/malloc.h b/runtime/src/shed/std/malloc.h new file mode 100644 index 00000000..86b50826 --- /dev/null +++ b/runtime/src/shed/std/malloc.h @@ -0,0 +1,15 @@ +#ifndef SHED_STD_MALLOC_H +#define SHED_STD_MALLOC_H + +#ifdef __wasm__ + +void* malloc(unsigned long); +void free(void*); + +#else + +#include + +#endif + +#endif -- cgit v1.2.3