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

ensure FontFileStream is cleaned up with its owning FontFile #22

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

lsalzman
Copy link

When FontFile::new_from_data is used, a FontFileStream is created and placed in a global HashMap that is never cleaned up. We only want the FontFileStream to live as long as the FontFile itself does.

Further, the API passes in a data slice to FontFile::new_from_data which is copied into FontFileStream, contributing to memory bloat. This modifies the API to use an Arc instead, so that the data can be properly shared.

@gw3583
Copy link

gw3583 commented Oct 18, 2018

@bors-servo r+

It'd be nice when we have some time to follow up with some details on the AddRef changes.

@bors-servo
Copy link

📌 Commit f4cda07 has been approved by gw3583

bors-servo pushed a commit that referenced this pull request Oct 18, 2018
ensure FontFileStream is cleaned up with its owning FontFile

When FontFile::new_from_data is used, a FontFileStream is created and placed in a global HashMap that is never cleaned up. We only want the FontFileStream to live as long as the FontFile itself does.

Further, the API passes in a data slice to FontFile::new_from_data which is copied into FontFileStream, contributing to memory bloat. This modifies the API to use an Arc instead, so that the data can be properly shared.
@bors-servo
Copy link

⌛ Testing commit f4cda07 with merge ac8ae4b...

@bors-servo
Copy link

☀️ Test successful - status-appveyor
Approved by: gw3583
Pushing ac8ae4b to master...

@bors-servo bors-servo merged commit f4cda07 into servo:master Oct 18, 2018
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.

3 participants