fix dead recursion when __NATIVE_USE_KLIB__ is defined
This commit is contained in:
parent
a873515bde
commit
f9b9b390fb
2 changed files with 16 additions and 2 deletions
|
@ -30,7 +30,13 @@ int atoi(const char* nptr) {
|
|||
}
|
||||
|
||||
void *malloc(size_t size) {
|
||||
// On native, malloc() will be called during initializaion of C runtime.
|
||||
// Therefore do not call panic() here, else it will yield a dead recursion:
|
||||
// panic() -> putchar() -> (glibc) -> malloc() -> panic()
|
||||
#if !(defined(__ISA_NATIVE__) && defined(__NATIVE_USE_KLIB__))
|
||||
panic("Not implemented");
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void free(void *ptr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue