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

platform/unix: Use `reserve_exact()` in `recv()` #130

Merged
merged 1 commit into from Jan 1, 2017

Conversation

@antrik
Copy link
Contributor

antrik commented Jan 1, 2017

Since we know exactly at this point how large the message will be, there
is no point in allowing the allocator to reserve more.

While this doesn't actually show any measurable difference here, it
still seems useful to express the constraint explicitly in the code --
to account for possible differences in allocators, for example; and
possibly for clarity?

Since we know exactly at this point how large the message will be, there
is no point in allowing the allocator to reserve more.

While this doesn't actually show any measurable difference here, it
still seems useful to express the constraint explicitly in the code --
to account for possible differences in allocators, for example; and
possibly for clarity?
@antrik
Copy link
Contributor Author

antrik commented Jan 1, 2017

To be honest, this is mostly to stop wasting time pondering whether it's worthwhile submitting a PR for that or not ;-)

@jdm
Copy link
Member

jdm commented Jan 1, 2017

Seems harmless :)
@bors-servo: r+

@bors-servo
Copy link
Contributor

bors-servo commented Jan 1, 2017

📌 Commit d964e4c has been approved by jdm

@highfive highfive assigned jdm and unassigned pcwalton Jan 1, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Jan 1, 2017

Testing commit d964e4c with merge a0cb867...

bors-servo added a commit that referenced this pull request Jan 1, 2017
platform/unix: Use `reserve_exact()` in `recv()`

Since we know exactly at this point how large the message will be, there
is no point in allowing the allocator to reserve more.

While this doesn't actually show any measurable difference here, it
still seems useful to express the constraint explicitly in the code --
to account for possible differences in allocators, for example; and
possibly for clarity?
@bors-servo
Copy link
Contributor

bors-servo commented Jan 1, 2017

☀️ Test successful - status-appveyor, status-travis

@bors-servo bors-servo merged commit d964e4c into servo:master Jan 1, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.