about summary refs log tree commit diff
path: root/library/std/src/alloc.rs
AgeCommit message (Collapse)AuthorLines
2023-01-02default OOM handler: use non-unwinding panic (unless -Zoom=panic is set), to ↵Ralf Jung-1/+1
match std handler
2022-09-03Forbid mixing `System` with sytem allocator callsChristopher Durham-1/+4
2022-06-26Update `std::alloc::System` docsLukas Wirth-1/+1
2022-06-18make std not use &A: Allocator instanceRalf Jung-4/+4
2022-06-07Add std::alloc::set_alloc_error_hook exampleLucas Dumont-0/+14
2022-05-04update `jemallocator` example to use 2018 edition import syntaxkraktus-2/+0
2022-04-05trivial cfg(bootstrap) changesPietro Albini-3/+0
2022-03-18Auto merge of #88098 - Amanieu:oom_panic, r=nagisabors-1/+15
Implement -Z oom=panic This PR removes the `#[rustc_allocator_nounwind]` attribute on `alloc_error_handler` which allows it to unwind with a panic instead of always aborting. This is then used to implement `-Z oom=panic` as per RFC 2116 (tracking issue #43596). Perf and binary size tests show negligible impact.
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-1/+1
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-03-03Add -Z oom={panic,abort} command-line optionAmanieu d'Antras-1/+15
2021-05-19Rename `rterr` to `rtprintpanic`Christiaan Dirkx-1/+1
2021-05-19Replace `sys_common::util::dumb_print` with `rterr!`Christiaan Dirkx-3/+1
2021-01-07Fix safety commentLingMan-2/+3
The size assertion in the comment was inverted compared to the code. After fixing that the implication that `(new_size >= old_size) => new_size != 0` still doesn't hold so explain why `old_size != 0` at this point.
2020-12-17Add missing punctuation to std::alloc docspierwill-1/+1
Add a period to first line of module docs to match other modules in std.
2020-12-04 Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate`Tim Diekmann-10/+10
2020-11-10Add missing newline to error message of the default OOM hookhyd-dev-1/+1
2020-09-28Rename AllocErr to AllocErrorJacob Hughes-10/+10
2020-09-22a few more &mut self -> self changesblitzerr-8/+8
2020-09-22removing &mut self for other methods of AllocRefblitzerr-2/+2
2020-09-21Changing the alloc() to accept &self instead of &mut selfblitzerr-2/+2
2020-09-08Capitalize safety commentsFlying-Toast-1/+1
2020-08-19Allow reallocation to different alignmentTim Diekmann-32/+53
2020-08-18Make `grow_impl` unsafeTim Diekmann-3/+6
2020-08-18Add comment, which was removed by accident (again)Tim Diekmann-0/+2
2020-08-18Clean up AllocRef implementation and documentationTim Diekmann-77/+77
2020-08-18Auto merge of #75621 - TimDiekmann:no-fast-realloc, r=Amanieubors-17/+10
Remove fast path in reallocation for same layout sizes r? @Amanieu Before merging a perf-run should be done. Closes https://github.com/rust-lang/wg-allocators/issues/70
2020-08-17Switch to intra-doc links for std/src/alloc.rsEllen-9/+0
2020-08-17Fix typo in commentTim Diekmann-2/+2
2020-08-17Remove fast path in reallocation for same layout sizesTim Diekmann-17/+10
2020-08-04Replace `Memoryblock` with `NonNull<[u8]>`Tim Diekmann-12/+16
2020-07-29Simplify implementations of `AllocRef` for `Global` and `System`Tim Diekmann-124/+73
2020-07-28Remove in-place allocation and revert to separate methods for zeroed allocationsTim Diekmann-66/+115
Fix docs
2020-07-27mv std libs to library/mark-0/+379