-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
[WIP] Deny OOM, embrace try_reserve
#448
base: trunk
Are you sure you want to change the base?
Conversation
269d391
to
5d4fae1
Compare
Codecov ReportAttention: 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. |
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
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
With Rust 1.57, several
try_reserve
methods 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_api
tracking issuenew_uninit
tracking issuetry_reserve
on more collections: tracking issueAnd uses the following features, although this could be implemented manually:
maybe_uninit_slice
tracking issuevec_spare_capacity
tracking issue (stabilized on jan 18, 2022)Other useful issues:
Vec::push_within_capacity
to reduce the amount of unsafe code to replaceVec::push
tracking issue