We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b758149 commit cb13c4dCopy full SHA for cb13c4d
library/std/src/alloc.rs
@@ -353,6 +353,9 @@ fn default_alloc_error_hook(layout: Layout) {
353
if unsafe { __rust_alloc_error_handler_should_panic != 0 } {
354
panic!("memory allocation of {} bytes failed", layout.size());
355
} else {
356
+ // This is the default path taken on OOM, and the only path taken on stable with std.
357
+ // Crucially, it does *not* call any user-defined code, and therefore there are no potential
358
+ // reentrancy issues. That makes it different from the default `__rdl_oom` defined in alloc.
359
rtprintpanic!("memory allocation of {} bytes failed\n", layout.size());
360
}
361
0 commit comments