Testing Rust OOM Handling with a Global Allocator Rust allows you to replace the global allocator with your own implementation. Typically, this is used to switch between the system allocator and jemalloc, but we can also use it for borderline-nefarious purposes: We’ll write a custom global all...
for method in ALLOCATOR_METHODS { @@ -73,23 +75,25 @@ pub(crate) unsafe fn codegen( true, ); // __rust_alloc_error_handler_should_panic let name = OomStrategy::SYMBOL; let ll_g = llvm::LLVMRustGetOrInsertGlobal(llmod, name.as_ptr().cast(), name.len(), i8); if tcx.sess...
not(no_global_oom_handling), not(no_rc), not(no_sync), target_has_atomic = "ptr" ))] #![no_std] #![needs_allocator] // To run alloc tests without x.py without ending up with two copies of alloc, Miri needs to be // able to "empty" this crate. See <https://github.com...
Rust is in the process of formalizing better support for fallible allocations, with anexperimental allocator in nightlyallowingfailed allocationsto be handled by the implementation. There is also the unstable cfg flag foralloccalledno_global_oom_handlingwhich removes the infallible methods, ensuring they...
@@ -3209,7 +3209,7 @@ impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> { } } // note: test pulls in libstd, which causes errors here // note: test pulls in std, which causes errors here #[cfg(not(no_global_oom_handling))] #[cfg(not(test))] #[stable(featur...
#17348use fallible indexing inTypeOrConstParam::source(…)andLifetimeParam::source(…). #17365expose snippet capability to diagnostic quickfixes. #17375don't intern attribute inputs, as their spans make them unique. #17341clean up inert attribute handling. ...
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...