Added some error messages to heap management code
This commit is contained in:
@@ -30,6 +30,7 @@ void __crt_heap_init(size_t sz)
|
||||
MX_VM_CAN_MAP_READ | MX_VM_CAN_MAP_WRITE | MX_VM_CAN_MAP_SPECIFIC,
|
||||
0, HEAP_REGION_SZ, &heap_vmar, &heap);
|
||||
if (status != MX_OK) {
|
||||
fprintf(stderr, "fatal: cannot allocate heap virtual region (%s)\n", mx_status_to_string(status));
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -38,6 +39,7 @@ void __crt_heap_init(size_t sz)
|
||||
MX_VM_CAN_MAP_READ | MX_VM_CAN_MAP_WRITE | MX_VM_CAN_MAP_SPECIFIC,
|
||||
&heap_vmo);
|
||||
if (status != MX_OK) {
|
||||
fprintf(stderr, "fatal: cannot allocate heap (%s)\n", mx_status_to_string(status));
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -46,6 +48,7 @@ void __crt_heap_init(size_t sz)
|
||||
0, heap_vmo, 0, sz,
|
||||
&heap);
|
||||
if (status != MX_OK) {
|
||||
fprintf(stderr, "fatal: cannot map heap (%s)\n", mx_status_to_string(status));
|
||||
abort();
|
||||
}
|
||||
|
||||
@@ -84,7 +87,7 @@ void *__crt_heap_extend(size_t sz)
|
||||
offset, heap_vmo, heap_sz, sz, &alloc_base);
|
||||
|
||||
if (err != MX_OK) {
|
||||
printf("cannot map extended heap: %s\n", mx_status_to_string(err));
|
||||
fprintf(stderr, "fatal: cannot map extended heap (%s)\n", mx_status_to_string(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user