We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b758149 commit b5ec268Copy full SHA for b5ec268
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. That makes it different from the
358
+ // default `__rdl_oom` defined in alloc.
359
rtprintpanic!("memory allocation of {} bytes failed\n", layout.size());
360
}
361
0 commit comments