expose malloc/free to apps through libc-shim stdlib.h

This commit is contained in:
Martin Fouilleul 2023-09-18 20:12:44 +02:00
parent e85d774245
commit 34303edd4e
1 changed files with 9 additions and 3 deletions

View File

@ -1,14 +1,20 @@
#ifndef _STDLIB_H #ifndef _STDLIB_H
#define _STDLIB_H #define _STDLIB_H
#include <stddef.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C" {
{
#endif #endif
#define abort(...) OC_ABORT(__VA_ARGS__) #define abort(...) OC_ABORT(__VA_ARGS__)
int abs(int); int abs(int);
void* malloc(size_t);
void* realloc(void*, size_t);
void* calloc(size_t count, size_t size);
void free(void*);
#ifdef __cplusplus #ifdef __cplusplus
} }