Skip to content

Conversation

@helo-xperi
Copy link

NOTE: This patch is intrusive. It's not necessarily expected that this patch can land in its current state, rather it is provided to spur discussion.

We are Chromium integrators and we've seen that processing some WOFF2 fonts can take up a lot of memory. This patch adds a new overload to OTSContext::Process in order to make it possible to use less memory while processing WOFF2 fonts. It does so via the following changes:

  • Makes ots::ExpandingMemoryStream part of public ots API.
  • Makes ots::ExpandingMemoryStream handle move-construct and move-assignment.
  • Adds an overload of ots::OTSContext::Process that takes an rvalue ref to ots::ExpandingMemoryStream as input buffer.
  • Makes ots::OTSContext::Process return the output buffer instead of writing to a separate output buffer.

Resolves #298

NOTE: This patch is intrusive. It's not necessarily expected that this
patch can land in its current state, rather it is provided to spur
discussion.

We are Chromium integrators and we've seen that processing some WOFF2
fonts can take up a lot of memory. This patch adds a new overload to
OTSContext::Process in order to make it possible to use less memory
while processing WOFF2 fonts. It does so via the following changes:

- Makes ots::ExpandingMemoryStream part of public ots API.
- Makes ots::ExpandingMemoryStream handle move-construct and
  move-assignment.
- Adds an overload of ots::OTSContext::Process that takes an rvalue ref
  to ots::ExpandingMemoryStream as input buffer.
- Makes ots::OTSContext::Process return the output buffer instead of
  writing to a separate output buffer.
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.

High memory use when parsing some WOFF2 fonts.

1 participant