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

Add blob wrapper for Arc<Vec<u8>> #135

Merged
merged 1 commit into from Mar 15, 2019
Merged

Add blob wrapper for Arc<Vec<u8>> #135

merged 1 commit into from Mar 15, 2019

Conversation

@raphlinus
Copy link
Contributor

raphlinus commented Mar 15, 2019

This change is Reviewable

@raphlinus
Copy link
Contributor Author

raphlinus commented Mar 15, 2019

Some results from my exploration: an additional box is needed around the Vec in any case, as HarfBuzz needs a thin pointer for the user_data field. I did a quick benchmark and found that the overhead of Arc is 84ns, while the overhead of Box is 70ns. This is in line with what I'd expect, it's one allocation in each case, but Arc is going to do (I believe) one additional atomic operation on drop.

Copy link
Collaborator

waywardmonkeys left a comment

I'd like someone else to take a look as well, but LGTM.

@jdm
Copy link
Member

jdm commented Mar 15, 2019

Agreed!
@bors-servo r=waywardmonkeys,jdm

@bors-servo
Copy link
Contributor

bors-servo commented Mar 15, 2019

📌 Commit 54c9be4 has been approved by waywardmonkeys,jdm

bors-servo added a commit that referenced this pull request Mar 15, 2019
Add blob wrapper for Arc<Vec<u8>>

<!-- 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-harfbuzz/135)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 15, 2019

Testing commit 54c9be4 with merge 0234774...

@bors-servo
Copy link
Contributor

bors-servo commented Mar 15, 2019

☀️ Test successful - checks-travis
Approved by: waywardmonkeys,jdm
Pushing 0234774 to master...

@bors-servo bors-servo merged commit 54c9be4 into servo:master Mar 15, 2019
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
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

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