Closed RalfJung closed 3 months ago
__rust_alloc_error_handler
will need similar handling to __rust_alloc
to call the function returned by rustc_ast::expand::allocator::alloc_error_handler_name(tcx.alloc_error_handler_kind(()).unwrap())
.
Does Miri support defining a finite heap?
No. Evaluation will just abort when Miri fails to allocate memory on the host.
__rust_alloc_error_handler will need similar handling to __rust_alloc to call the function returned by rustc_ast::expand::allocator::alloc_error_handler_name(tcx.alloc_error_handler_kind(()).unwrap()).
There's a strange difference though; for the allocator, the attribute directly generates symbols with the name __rust_alloc
but for the handler there's an indirection and it generates __rg_oom
instead.
We don't support whatever magic links in the alloc error handler, it seems: