-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename OOM to allocation error #51543
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
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. |
Is the use of the word "bail" something we've done elsewhere? |
@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 |
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.. |
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 |
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... |
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. |
I don't understand what's wrong with |
I am not convinced this is an improvement. If there's uncertainty we should destabilize this function. |
🚲 How about |
|
@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 |
Sorry, could someone please explain why we need renaming at all? Oom is pretty standard terminology in systems. |
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.) |
To be clear: I think renaming would be nicer, but if we don’t reach consensus in time I can live with |
This reminds me of how before 1.0 all our filesystem APIs were called things like |
|
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`
Done :) |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Diff is very mechanical. @bors r+ |
📌 Commit 2b789bd has been approved by |
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`
☀️ Test successful - status-appveyor, status-travis |
The acronym is not descriptive unless one has seen it before.
oom
function 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_hook
toset_alloc_error_hook
take_oom_hook
totake_alloc_error_hook
Bikeshed:
on
v.s.for
,alloc
v.s.allocator
,error
v.s.failure