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" {
26
26
fn __rust_realloc ( ptr : * mut u8 , old_size : usize , align : usize , new_size : usize ) -> * mut u8 ;
27
27
#[ rustc_allocator_nounwind]
28
28
fn __rust_alloc_zeroed ( size : usize , align : usize ) -> * mut u8 ;
29
- #[ rustc_allocator_nounwind]
30
- fn __rust_alloc_error_handler ( size : usize , align : usize ) -> !;
31
29
}
32
30
33
31
/// The global memory allocator.
@@ -323,6 +321,16 @@ pub(crate) unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
323
321
}
324
322
}
325
323
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
+
326
334
/// Abort on memory allocation error or failure.
327
335
///
328
336
/// Callers of memory allocation APIs wishing to abort computation
You can’t perform that action at this time.
0 commit comments