This repository was archived by the owner on Aug 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 304
[WIP] Deny OOM, embrace try_reserve
#448
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
269d391 to
5d4fae1
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #448 +/- ##
==========================================
- Coverage 57.21% 57.05% -0.16%
==========================================
Files 51 51
Lines 4410 4427 +17
==========================================
+ Hits 2523 2526 +3
- Misses 1887 1901 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b806672 to
f2731c0
Compare
f2731c0 to
8466fff
Compare
8466fff to
c1e6e67
Compare
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
cef0e15 to
fb27373
Compare
ghost
suggested changes
Oct 4, 2022
eeeefa5 to
9d58ec1
Compare
9d58ec1 to
1c67710
Compare
Added try_reserve to VecWriter, Vec, VecDeque and HashMap Made the OOM test succeed on the latest nightly Made the OOM check work on nightly Disabled stable checks for now Removed feature that is stable in current nightly Fixed issue where Box<[T]> would not do the size limit check Added a drop guard to `impl<T> Decode for Vec<T>` to make sure memory is not leaked when T::Decode panics Made the implementation of `VecWriter` use less lines of unsfe Fixed errors while merging
…did not fix the runtime error
cea3f8d to
735e175
Compare
This pull request was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

With Rust 1.57, several
try_reservemethods have been stabilized. This PR makes bincode take advantage of this.A nightly flag can be set to disable all fallible allocations. This is currently blocked on the following features:
allocator_apitracking issuenew_uninittracking issuetry_reserveon more collections: tracking issueAnd uses the following features, although this could be implemented manually:
maybe_uninit_slicetracking issuevec_spare_capacitytracking issue (stabilized on jan 18, 2022)Other useful issues:
Vec::push_within_capacityto reduce the amount of unsafe code to replaceVec::pushtracking issue