diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-13 09:06:53 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-13 09:06:53 +0200 |
commit | ed869aa3867d134fb37f586f1db029006677cebb (patch) | |
tree | a34cb31b0359d98e0be8a1269535f8f660c7db68 /src/libc/stdlib.c | |
parent | 08487fb5bfd7f5e1d9564d4132d38592d2dd0cc2 (diff) | |
download | abaos-ed869aa3867d134fb37f586f1db029006677cebb.tar.gz abaos-ed869aa3867d134fb37f586f1db029006677cebb.tar.bz2 |
separated C library implementations with an OS_ABAOS define (for now),
we cannot test stdio and memory management in the hosted environment yet
this way
Diffstat (limited to 'src/libc/stdlib.c')
-rw-r--r-- | src/libc/stdlib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libc/stdlib.c b/src/libc/stdlib.c index 9150431..d6bb8b2 100644 --- a/src/libc/stdlib.c +++ b/src/libc/stdlib.c @@ -46,22 +46,29 @@ char *itoa( int v, char *s, int base ) return s; } +#ifdef OS_ABAOS // TODO: we should have a global memory manager and one per // user process later static memory_manager_t *stdlib_memory_manager = NULL; +#endif void *malloc( size_t size ) { +#ifdef OS_ABAOS return memory_manager_allocate( stdlib_memory_manager, size ); +#endif } void free( void *p ) { +#ifdef OS_ABAOS memory_manager_deallocate( stdlib_memory_manager, &p ); +#endif } +#ifdef OS_ABAOS void __stdlib_set_memory_manager( memory_manager_t *memory_manager ) { stdlib_memory_manager = memory_manager; } - +#endif |