summary refs log tree commit diff
path: root/src/liballoc/alloc.rs
AgeCommit message (Collapse)AuthorLines
2019-06-08Turn `#[allocator]` into a built-in attribute and rename it to ↵Vadim Petrochenkov-1/+2
`#[rustc_allocator]`
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-0/+18
2019-04-18make liballoc internal test suite mostly pass in MiriRalf Jung-0/+1
2019-02-13Clarify guarantees for `Box` allocationJethro Beekman-0/+3
2019-02-03liballoc: revert nested imports style changes.Mazdak Farrokhzad-9/+5
2019-02-02liballoc: apply uniform_paths.Mazdak Farrokhzad-1/+1
2019-02-02liballoc: refactor & fix some imports.Mazdak Farrokhzad-5/+9
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-12global allocators: add a few commentsRalf Jung-0/+4
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-1/+1
2018-08-14Add doc examples for std::alloc::{alloc,alloc_zeroed}.Corey Farwell-0/+31
2018-06-18Rename OOM to allocation errorSimon Sapin-7/+7
The acronym is not descriptive unless one has seen it before. * Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle. * Rename `set_oom_hook` to `set_alloc_error_hook` * Rename `take_oom_hook` to `take_alloc_error_hook` Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`
2018-06-11More alloc docs tweaksSimon Sapin-2/+4
2018-06-11Stabilize alloc::oom (but not set_oom_hook or take_oom_hook)Simon Sapin-1/+1
2018-06-11Stabilize alloc free functions for the global allocators.Simon Sapin-4/+4
2018-06-11Stablize the alloc module without changing stability of its contents.Simon Sapin-6/+5
2018-06-11Document memory allocation APIsSimon Sapin-0/+65
Add some docs where they were missing, attempt to fix them where they were out of date.
2018-06-11Remove the deprecated Heap type/constSimon Sapin-9/+0
2018-06-11Replace `impl GlobalAlloc for Global` with a set of free functionsMike Hommey-23/+25
2018-06-11Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAllocMike Hommey-18/+15
2018-05-30Pass a `Layout` to `oom`Mike Hommey-6/+7
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-24std: Ensure OOM is classified as `nounwind`Alex Crichton-0/+1
OOM can't unwind today, and historically it's been optimized as if it can't unwind. This accidentally regressed with recent changes to the OOM handler, so this commit adds in a codegen test to assert that everything gets optimized away after the OOM function is approrpiately classified as nounwind Closes #50925
2018-05-17Auto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichtonbors-46/+1
Switch to bootstrapping from 1.27 It's possible the Float trait could be removed from core, but I couldn't tell whether it was intended to be removed or not. @SimonSapin may be able to comment more here; we can presumably also do that in a follow up PR as this one is already quite large.
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-46/+1
2018-05-17Rename trans to codegen everywhere.Irina Popa-1/+1
2018-04-27Auto merge of #50097 - glandium:box_free, r=nikomatsakisbors-3/+11
Partial future-proofing for Box<T, A> In some ways, this is similar to @eddyb's PR #47043 that went stale, but doesn't cover everything. Notably, this still leaves Box internalized as a pointer in places, so practically speaking, only ZSTs can be practically added to the Box type with the changes here (the compiler ICEs otherwise). The Box type is not changed here, that's left for the future because I want to test that further first, but this puts things in place in a way that hopefully will make things easier.
2018-04-25Switch box_free to take the destructured contents of BoxMike Hommey-3/+11
As of now, Box only contains a Unique pointer, so this is the sole argument to box_free. Consequently, we remove the code supporting the previous box_free signature. We however keep the old definition for bootstrapping purpose.
2018-04-22Remove Alloc::oomSteven Fackler-5/+0
2018-04-22Replace GlobalAlloc::oom with a lang itemSteven Fackler-17/+18
2018-04-12Rename alloc::Void to alloc::OpaqueSimon Sapin-13/+13
2018-04-12Remove conversions for allocated pointersSimon Sapin-3/+3
One was now unused, and `NonNull::new(…).ok_or(AllocErr)` feels short enough for the few cases that need the other conversion.
2018-04-12Use NonNull<Void> instead of *mut u8 in the Alloc traitMike Hommey-9/+10
Fixes #49608
2018-04-12impl GlobalAlloc for GlobalSimon Sapin-35/+50
2018-04-12Restore Global.oom() functionalitySimon Sapin-0/+16
… now that #[global_allocator] does not define a symbol for it
2018-04-12realloc with a new size only, not a full new layout.Simon Sapin-13/+9
Changing the alignment with realloc is not supported.
2018-04-12Remove the now-unit-struct AllocErr parameter of oom()Simon Sapin-3/+3
2018-04-12Use the GlobalAlloc trait for #[global_allocator]Simon Sapin-148/+40
2018-04-12Make AllocErr a zero-size unit structSimon Sapin-16/+16
2018-04-12Separate alloc::heap::Alloc trait for stage0 #[global_allocator]Simon Sapin-5/+0
2018-04-12Actually deprecate the Heap typeSimon Sapin-2/+6
2018-04-12Rename the Heap type to GlobalSimon Sapin-9/+14
… since it is the entry point for what’s registered with `#[global_allocator]`
2018-04-12Actually deprecate heap modules.Simon Sapin-1/+1
2018-04-12Rename `heap` modules in the core, alloc, and std crates to `alloc`Simon Sapin-0/+291