diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index 2ec1c8fbe..18b80b5bb 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -56,6 +56,7 @@ struct hb_bit_set_invertible_t bool in_error () const { return s.in_error (); } explicit operator bool () const { return !is_empty (); } + void alloc (unsigned sz) { s.alloc (sz); } void reset () { s.reset (); diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index f20014576..e98e7377a 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -97,6 +97,13 @@ struct hb_bit_set_t return true; } + void alloc (unsigned sz) + { + sz >>= (page_t::PAGE_BITS_LOG_2 - 1); + pages.alloc (sz); + page_map.alloc (sz); + } + void reset () { successful = true; diff --git a/src/hb-set.hh b/src/hb-set.hh index 9eacaf4f6..18274b2f2 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -77,6 +77,7 @@ struct hb_sparseset_t void err () { s.err (); } bool in_error () const { return s.in_error (); } + void alloc (unsigned sz) { s.alloc (sz); } void reset () { s.reset (); } void clear () { s.clear (); } void invert () { s.invert (); }