Uh oh!
There was an error while loading. Please reload this page.
Rename OOM to allocation error - #51543
Conversation
rust-highfive
commented
Jun 13, 2018
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
SimonSapin
commented
Jun 13, 2018
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
withoutboats
commented
Jun 13, 2018
Is the use of the word "bail" something we've done elsewhere? |
SimonSapin
commented
Jun 13, 2018
@withoutboats Not that I know of. I’m open to another way to express "this this what you call when you don’t want to handle that condition". I’ve avoided "abort" because of https://github.com/rust-lang/rfcs/blob/master/text/2116-alloc-me-maybe.md#oompanic |
withoutboats
commented
Jun 13, 2018
The main reason I'm not excited about bail is its used in other contexts to mean something very different: for example, both error-chain and failure have I'm not sure what other word would be appropriate, though.. |
rust-highfive
commented
Jun 13, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Mark-Simulacrum
commented
Jun 14, 2018
Note that we could backport the name change to beta, though I'd rather not. If there are concerns over naming, perhaps we should land a change de-stabilizing oom for the time being? I suppose that would be rather hard... |
SimonSapin
commented
Jun 14, 2018
The FCP is used as a tool to get more eyes on this, but we won’t actually wait for the 10 days period. Destabilizing is an option, but I expect we won’t need it. |
mark-i-m
commented
Jun 14, 2018
I don't understand what's wrong with |
sfackler
commented
Jun 14, 2018
I am not convinced this is an improvement. If there's uncertainty we should destabilize this function. |
hanna-kruppe
commented
Jun 14, 2018
🚲 How about |
glandium
commented
Jun 14, 2018
|
SimonSapin
commented
Jun 14, 2018
@rkruppe I think that this function is less about reporting (which might or might not happen) than it is about never returning so that callers don’t need to care about that code path anymore. |
The language theory for this is to diverge, but I'm not sure if |
mark-i-m
commented
Jun 15, 2018
Sorry, could someone please explain why we need renaming at all? Oom is pretty standard terminology in systems. |
SimonSapin
commented
Jun 15, 2018
I think that how standard OOM sounds depends on one’s background, but more importantly these APIs are used for any kind of error/failure that is not necessarily caused but exhaustion of available memory. (For example, the requested alignment is not supported by this allocator.) |
SimonSapin
commented
Jun 15, 2018
To be clear: I think renaming would be nicer, but if we don’t reach consensus in time I can live with |
withoutboats
commented
Jun 15, 2018
This reminds me of how before 1.0 all our filesystem APIs were called things like |
SimonSapin
commented
Jun 18, 2018
|
withoutboats
commented
Jun 18, 2018
handle_alloc_error seems fine to me :) |
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`
SimonSapin
commented
Jun 19, 2018
Done :) |
rfcbot
commented
Jun 19, 2018
🔔 This is now entering its final comment period, as per the review above. 🔔 |
SimonSapin
commented
Jun 19, 2018
Diff is very mechanical. @bors r+ |
bors
commented
Jun 19, 2018
📌 Commit 2b789bd has been approved by |
bors
commented
Jun 19, 2018
Rename OOM to allocation error 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: `on` v.s. `for`, `alloc` v.s. `allocator`, `error` v.s. `failure`
bors
commented
Jun 19, 2018
☀️ Test successful - status-appveyor, status-travis |
The acronym is not descriptive unless one has seen it before.
oomfunction tohandle_alloc_error. It was stabilized in 1.28, so if we do this at all we need to land it this cycle.set_oom_hooktoset_alloc_error_hooktake_oom_hooktotake_alloc_error_hookBikeshed:
onv.s.for,allocv.s.allocator,errorv.s.failure