[cff-subset] Adjust pre-allocation

Reduces memory use significantly.
pull/3993/head
Behdad Esfahbod 2 years ago
parent b88ca81814
commit 0ec0214f10
  1. 2
      src/hb-cff-interp-common.hh
  2. 2
      src/hb-subset-cff-common.hh

@ -522,7 +522,7 @@ struct parsed_values_t
void alloc (unsigned n)
{
values.alloc (n);
values.alloc (n, true);
}
void add_op (op_code_t op, const byte_str_ref_t& str_ref = byte_str_ref_t ())

@ -644,7 +644,7 @@ struct subr_subsetter_t
ENV env (str, acc, fd);
cs_interpreter_t<ENV, OPSET, subr_subset_param_t> interp (env);
parsed_charstrings[i].alloc (str.length / 2);
parsed_charstrings[i].alloc (str.length);
subr_subset_param_t param (&parsed_charstrings[i],
&parsed_global_subrs_storage,
&parsed_local_subrs_storage[fd],

Loading…
Cancel
Save