Closed lsalzman closed 6 years ago
@bors-servo r+
It'd be nice when we have some time to follow up with some details on the AddRef changes.
:pushpin: Commit f4cda07 has been approved by gw3583
:hourglass: Testing commit f4cda07fef5b51d277b9e57a2d16eee123ad8e27 with merge ac8ae4bfe8d12c4202ed5acbcaf1482f79244ba7...
:sunny: Test successful - status-appveyor Approved by: gw3583 Pushing ac8ae4bfe8d12c4202ed5acbcaf1482f79244ba7 to master...
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.