diff options
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-pool.hh')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-pool.hh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-pool.hh b/src/3rdparty/harfbuzz-ng/src/hb-pool.hh index dcf8f6627d..ee43721a38 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-pool.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-pool.hh @@ -31,19 +31,17 @@ /* Memory pool for persistent allocation of small objects. */ -template <typename T, unsigned ChunkLen = 16> +template <typename T, unsigned ChunkLen = 32> struct hb_pool_t { hb_pool_t () : next (nullptr) {} - ~hb_pool_t () { fini (); } - - void fini () + ~hb_pool_t () { next = nullptr; - for (chunk_t *_ : chunks) hb_free (_); - - chunks.fini (); + + hb_iter (chunks) + | hb_apply (hb_free) + ; } T* alloc () @@ -60,7 +58,7 @@ struct hb_pool_t T* obj = next; next = * ((T**) next); - memset (obj, 0, sizeof (T)); + hb_memset (obj, 0, sizeof (T)); return obj; } |