Add ability to register custom error function called on various error conditions; including ENOMEM

This commit is contained in:
daan 2020-01-17 19:59:55 -08:00
parent 3e982a3813
commit dc58388968
20 changed files with 342 additions and 127 deletions

View file

@ -157,7 +157,7 @@ static bool _mi_heap_init(void) {
// use `_mi_os_alloc` to allocate directly from the OS
mi_thread_data_t* td = (mi_thread_data_t*)_mi_os_alloc(sizeof(mi_thread_data_t),&_mi_stats_main); // Todo: more efficient allocation?
if (td == NULL) {
_mi_error_message("failed to allocate thread local heap memory\n");
_mi_error_message(ENOMEM, "failed to allocate thread local heap memory\n");
return false;
}
mi_tld_t* tld = &td->tld;