lib: c: combine libc and ulibc

libc is now made up of several independent components, each of which is individually compiled into a static library.
they are then all combined into a single shared library.
This commit is contained in:
2026-03-06 20:12:58 +00:00
parent 267b893bf4
commit 68714fa0e5
33 changed files with 1695 additions and 8483 deletions

View File

@@ -0,0 +1,44 @@
#include <heap/heap.h>
#ifdef ENABLE_GLOBAL_HEAP
static heap_t global_heap = HEAP_INIT;
void *malloc(size_t count)
{
return heap_alloc(&global_heap, count);
}
void *calloc(size_t count, size_t size)
{
return heap_calloc(&global_heap, count, size);
}
void *realloc(void *p, size_t count)
{
return heap_realloc(&global_heap, p, count);
}
void free(void *p)
{
heap_free(&global_heap, p);
}
#else
void *malloc(size_t count)
{
return NULL;
}
void *calloc(size_t count, size_t size)
{
return NULL;
}
void *realloc(void *p, size_t count)
{
return NULL;
}
void free(void *p)
{
}
#endif