[cff-subset] Adjust pre-allocation

Reduces memory use significantly.
This commit is contained in:
Behdad Esfahbod 2022-12-31 13:18:32 -07:00
parent b88ca81814
commit 0ec0214f10
2 changed files with 2 additions and 2 deletions

View File

@ -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 ())

View File

@ -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],