Remove the pre_allocate argument from hb_buffer_create()
For two reasons:
1. User can always call hb_buffer_pre_allocate() themselves, and
2. Now we do a pre_alloc in add_utfX anyway, so the total number of
reallocs is limited to a small number (~3) anyway. This just makes the
API cleaner.
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 3f46d68..c3cff08 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -486,7 +486,7 @@
/* Public API */
hb_buffer_t *
-hb_buffer_create (unsigned int pre_alloc_size)
+hb_buffer_create ()
{
hb_buffer_t *buffer;
@@ -495,11 +495,6 @@
buffer->reset ();
- if (pre_alloc_size && !buffer->ensure (pre_alloc_size)) {
- hb_buffer_destroy (buffer);
- return &_hb_buffer_nil;
- }
-
return buffer;
}