File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ extern "Rust" {
2626 fn __rust_realloc ( ptr : * mut u8 , old_size : usize , align : usize , new_size : usize ) -> * mut u8 ;
2727 #[ rustc_allocator_nounwind]
2828 fn __rust_alloc_zeroed ( size : usize , align : usize ) -> * mut u8 ;
29- #[ rustc_allocator_nounwind]
30- fn __rust_alloc_error_handler ( size : usize , align : usize ) -> !;
3129}
3230
3331/// The global memory allocator.
@@ -323,6 +321,16 @@ pub(crate) unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
323321 }
324322}
325323
324+ // # Allocation error handler
325+
326+ extern "Rust" {
327+ // This is the magic symbol to call the global alloc error handler. rustc generates
328+ // it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the
329+ // default implementations below (`__rdl_oom`) otherwise.
330+ #[ rustc_allocator_nounwind]
331+ fn __rust_alloc_error_handler ( size : usize , align : usize ) -> !;
332+ }
333+
326334/// Abort on memory allocation error or failure.
327335///
328336/// Callers of memory allocation APIs wishing to abort computation
You can’t perform that action at this time.
0 commit comments