Skip to content
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

fix from_slice possible overallocation #122

Merged
merged 1 commit into from Aug 23, 2018

Conversation

llogiq
Copy link
Contributor

@llogiq llogiq commented Aug 23, 2018

@arthurps found that the code would underreport the vec's capacity if slice.to_vec() allocated more than len entries. This changes the code to set the correct capacity as reported from the vec.


This change is Reviewable

@arthurps found that the code would underreport the vec's capacity
if `slice.to_vec()` allocated more than `len` entries. This
changes the code to set the correct capacity as reported from the
`vec`.
@mbrubeck
Copy link
Collaborator

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 3400726 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

⌛ Testing commit 3400726 with merge 65f72d1...

bors-servo pushed a commit that referenced this pull request Aug 23, 2018
fix from_slice possible overallocation

@arthurps found that the code would underreport the vec's capacity if `slice.to_vec()` allocated more than `len` entries. This changes the code to set the correct capacity as reported from the `vec`.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/122)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: mbrubeck
Pushing 65f72d1 to master...

@bors-servo bors-servo merged commit 3400726 into servo:master Aug 23, 2018
@mbrubeck
Copy link
Collaborator

cc #118

mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Nov 15, 2018
Changes in this release:

* Fix possible over-allocation in `from_slice` (servo#122)
* Optional nightly-only `specialization` feature for `from_slice`
  optimization (servo#123)
* New `from_raw_parts` constructor (servo#130)
* Documentation and testing improvements (servo#125, servo#129)
@mbrubeck mbrubeck mentioned this pull request Nov 15, 2018
bors-servo pushed a commit that referenced this pull request Nov 16, 2018
Version 0.6.6

Changes in this release:

* Fix possible over-allocation in `from_slice` (#122)
* Optional nightly-only `specialization` feature for `from_slice` optimization (#123)
* New `from_raw_parts` constructor (#130)
* Documentation and testing improvements (#125, #129)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/131)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants