diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-11-26 22:01:42 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-27 12:01:42 +1100 |
| commit | 6dd16009361b2561f77b7933981611a9b975fa21 (patch) | |
| tree | 606f9bd82debe312be65d4e05798e9dc2435ae41 /src/boot/O2/system_malloc.c | |
| parent | 34492a4386446fc82220fe0684ff521d760e84bd (diff) | |
Organize `libc64` files (#1492)
* Move qrand to libc64
* use an union to avoid type punning
* __osMalloc
* math64.c
* fixed_point.h
* sleep
* aprintf.h
* sprintf
* malloc
* use original names on aprintf.c and malloc.c
* qrand cleanup pass
* use original names of sleep.c
* og names for sprintf
* more cleanup
* format
* fixes
* whoops
* use ARRAY_COUNT again
* comment
* Use `fu`
* forgot this one
* review
* fix
* sneak a tiny cleanup
Diffstat (limited to 'src/boot/O2/system_malloc.c')
| -rw-r--r-- | src/boot/O2/system_malloc.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/boot/O2/system_malloc.c b/src/boot/O2/system_malloc.c deleted file mode 100644 index e7dc064fc..000000000 --- a/src/boot/O2/system_malloc.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "global.h" -#include "os_malloc.h" - -Arena gSystemArena; - -void* SystemArena_Malloc(size_t size) { - return __osMalloc(&gSystemArena, size); -} - -void* SystemArena_MallocR(size_t size) { - return __osMallocR(&gSystemArena, size); -} - -void* SystemArena_Realloc(void* oldPtr, size_t newSize) { - return __osRealloc(&gSystemArena, oldPtr, newSize); -} - -void SystemArena_Free(void* ptr) { - __osFree(&gSystemArena, ptr); -} - -void* SystemArena_Calloc(size_t num, size_t size) { - void* ptr; - size_t totalSize = num * size; - - ptr = __osMalloc(&gSystemArena, totalSize); - if (ptr != NULL) { - bzero(ptr, totalSize); - } - return ptr; -} - -void SystemArena_GetSizes(size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated) { - __osGetSizes(&gSystemArena, maxFreeBlock, bytesFree, bytesAllocated); -} - -u32 SystemArena_CheckArena(void) { - return __osCheckArena(&gSystemArena); -} - -void SystemArena_Init(void* start, size_t size) { - __osMallocInit(&gSystemArena, start, size); -} - -void SystemArena_Cleanup(void) { - __osMallocCleanup(&gSystemArena); -} - -u8 SystemArena_IsInitialized(void) { - return __osMallocIsInitalized(&gSystemArena); -} |
