-
-
Notifications
You must be signed in to change notification settings - Fork 775
perf(allocator/vec): remove alloc_guard from RawVec::from_raw_parts_in + clarify safety docs
#11073
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
Conversation
CodSpeed Instrumentation Performance ReportMerging #11073 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
cab4f00 to
51b5b12
Compare
Dunqing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the caller must meet safety requirements; otherwise, UB is expected!
Merge activity
|
…s_in` + clarify safety docs (#11073) Follow-on after #10884. We don't need `alloc_guard` here. `RawVec::from_raw_parts_in` is an unsafe method, and caller guarantees that `len` and `capacity` are in legal range. We don't need to check the caller fulfilled that guarantee - that responsibility is on them. Also clarify the safety docs for this method.
12938de to
7c84a56
Compare
51b5b12 to
7e69c08
Compare

Follow-on after #10884.
We don't need
alloc_guardhere.RawVec::from_raw_parts_inis an unsafe method, and caller guarantees thatlenandcapacityare in legal range. We don't need to check the caller fulfilled that guarantee - that responsibility is on them.Also clarify the safety docs for this method.