about summary refs log tree commit diff
path: root/src/libstd/alloc.rs
AgeCommit message (Collapse)AuthorLines
2018-06-01Make the OOM hook return `()` rather than `!`Mike Hommey-10/+12
Per discussion in https://github.com/rust-lang/rust/issues/51245#issuecomment-393651083 This allows more flexibility in what can be done with the API. This also splits `rtabort!` into `dumb_print` happening in the default hook and `abort_internal`, happening in the actual oom handler after calling the hook. Registering an empty function thus makes the oom handler not print anything but still abort. Cc: @alexcrichton
2018-05-30Add hooks allowing to override the `oom` behaviorMike Hommey-2/+46
2018-05-30Pass a `Layout` to `oom`Mike Hommey-2/+2
As discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-384893456 and subsequent, there are use-cases where the OOM handler needs to know the size of the allocation that failed. The alignment might also be a cause for allocation failure, so providing it as well can be useful.
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-61/+0
2018-04-22Replace GlobalAlloc::oom with a lang itemSteven Fackler-2/+11
2018-04-12Rename alloc::Void to alloc::OpaqueSimon Sapin-3/+3
2018-04-12Restore Global.oom() functionalitySimon Sapin-0/+6
… now that #[global_allocator] does not define a symbol for it
2018-04-12Use the GlobalAlloc trait for #[global_allocator]Simon Sapin-99/+54
2018-04-12Make AllocErr a zero-size unit structSimon Sapin-30/+13
2018-04-12Actually deprecate the Heap typeSimon Sapin-1/+2
2018-04-12Actually deprecate heap modules.Simon Sapin-3/+3
2018-04-12Rename `heap` modules in the core, alloc, and std crates to `alloc`Simon Sapin-0/+176