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,
|
MX_VM_CAN_MAP_READ | MX_VM_CAN_MAP_WRITE | MX_VM_CAN_MAP_SPECIFIC,
|
||||||
0, HEAP_REGION_SZ, &heap_vmar, &heap);
|
0, HEAP_REGION_SZ, &heap_vmar, &heap);
|
||||||
if (status != MX_OK) {
|
if (status != MX_OK) {
|
||||||
|
fprintf(stderr, "fatal: cannot allocate heap virtual region (%s)\n", mx_status_to_string(status));
|
||||||
abort();
|
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,
|
MX_VM_CAN_MAP_READ | MX_VM_CAN_MAP_WRITE | MX_VM_CAN_MAP_SPECIFIC,
|
||||||
&heap_vmo);
|
&heap_vmo);
|
||||||
if (status != MX_OK) {
|
if (status != MX_OK) {
|
||||||
|
fprintf(stderr, "fatal: cannot allocate heap (%s)\n", mx_status_to_string(status));
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,6 +48,7 @@ void __crt_heap_init(size_t sz)
|
|||||||
0, heap_vmo, 0, sz,
|
0, heap_vmo, 0, sz,
|
||||||
&heap);
|
&heap);
|
||||||
if (status != MX_OK) {
|
if (status != MX_OK) {
|
||||||
|
fprintf(stderr, "fatal: cannot map heap (%s)\n", mx_status_to_string(status));
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +87,7 @@ void *__crt_heap_extend(size_t sz)
|
|||||||
offset, heap_vmo, heap_sz, sz, &alloc_base);
|
offset, heap_vmo, heap_sz, sz, &alloc_base);
|
||||||
|
|
||||||
if (err != MX_OK) {
|
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();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user