diff --git a/kinclude/malloc.c b/kinclude/malloc.c index cb3226c..ac395a0 100644 --- a/kinclude/malloc.c +++ b/kinclude/malloc.c @@ -11,17 +11,8 @@ void malloc_init(malloc_info* given_info) allocate_memory_end = given_info->allocate_memory_end; } -optional_voidptr malloc(size_t size) -{ - return (optional_voidptr) { .error = ENOMEM }; -} - -int free(void* ptr) -{ - return EINVAL; -} - // allocate stack and return a pointer to the *end* of the allocated region +// this doesn't reuse stack from functions which exited optional_voidptr malloc_stack(size_t size) { void* new_alloc_end = (void*) (((int) allocate_memory_end) - size); diff --git a/kinclude/malloc.h b/kinclude/malloc.h index 57be51d..f3225d9 100644 --- a/kinclude/malloc.h +++ b/kinclude/malloc.h @@ -8,9 +8,6 @@ typedef struct malloc_info { void* allocate_memory_start; } malloc_info; -optional_voidptr malloc(size_t size); -// int free(void* ptr); - optional_voidptr malloc_stack(size_t size); void malloc_init(malloc_info* info);