bootloader heap: more detailed errors on out-of-memory
It's hard enough to debug bootloader code already, let's gather as much info as we can from error messages. Change-Id: I47dff402286625d1213caa36ae6ee8ecf707dfad Reviewed-on: https://review.haiku-os.org/c/haiku/+/3574 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -464,7 +464,8 @@ malloc(size_t size)
|
||||
return malloc_large(size);
|
||||
|
||||
if (size > sAvailable) {
|
||||
dprintf("malloc(): Out of memory!\n");
|
||||
dprintf("malloc(): Out of memory allocating a block of %ld bytes, "
|
||||
"only %ld left!\n", size, sAvailable);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -473,7 +474,8 @@ malloc(size_t size)
|
||||
|
||||
if (chunk == NULL) {
|
||||
// could not find a free chunk as large as needed
|
||||
dprintf("malloc(): Out of memory!\n");
|
||||
dprintf("malloc(): Out of memory allocating a block of %ld bytes, "
|
||||
"no free chunks!\n", size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user