[set] Add pre-allocation internal API
This commit is contained in:
parent
48dfbd54a3
commit
1f578b5a32
|
@ -56,6 +56,7 @@ struct hb_bit_set_invertible_t
|
||||||
bool in_error () const { return s.in_error (); }
|
bool in_error () const { return s.in_error (); }
|
||||||
explicit operator bool () const { return !is_empty (); }
|
explicit operator bool () const { return !is_empty (); }
|
||||||
|
|
||||||
|
void alloc (unsigned sz) { s.alloc (sz); }
|
||||||
void reset ()
|
void reset ()
|
||||||
{
|
{
|
||||||
s.reset ();
|
s.reset ();
|
||||||
|
|
|
@ -97,6 +97,13 @@ struct hb_bit_set_t
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void alloc (unsigned sz)
|
||||||
|
{
|
||||||
|
sz >>= (page_t::PAGE_BITS_LOG_2 - 1);
|
||||||
|
pages.alloc (sz);
|
||||||
|
page_map.alloc (sz);
|
||||||
|
}
|
||||||
|
|
||||||
void reset ()
|
void reset ()
|
||||||
{
|
{
|
||||||
successful = true;
|
successful = true;
|
||||||
|
|
|
@ -77,6 +77,7 @@ struct hb_sparseset_t
|
||||||
void err () { s.err (); }
|
void err () { s.err (); }
|
||||||
bool in_error () const { return s.in_error (); }
|
bool in_error () const { return s.in_error (); }
|
||||||
|
|
||||||
|
void alloc (unsigned sz) { s.alloc (sz); }
|
||||||
void reset () { s.reset (); }
|
void reset () { s.reset (); }
|
||||||
void clear () { s.clear (); }
|
void clear () { s.clear (); }
|
||||||
void invert () { s.invert (); }
|
void invert () { s.invert (); }
|
||||||
|
|
Loading…
Reference in New Issue