| Index: third_party/harfbuzz-ng/src/hb-buffer.cc
|
| diff --git a/third_party/harfbuzz-ng/src/hb-buffer.cc b/third_party/harfbuzz-ng/src/hb-buffer.cc
|
| index 5f320bd7eb6a7538477c5aa3a76d9430600d3da3..406db9c84fce18fb1b0b88a53e161bac7f9a8e53 100644
|
| --- a/third_party/harfbuzz-ng/src/hb-buffer.cc
|
| +++ b/third_party/harfbuzz-ng/src/hb-buffer.cc
|
| @@ -242,11 +242,11 @@ hb_buffer_t::clear (void)
|
| out_info = info;
|
|
|
| serial = 0;
|
| - memset (allocated_var_bytes, 0, sizeof allocated_var_bytes);
|
| - memset (allocated_var_owner, 0, sizeof allocated_var_owner);
|
|
|
| memset (context, 0, sizeof context);
|
| memset (context_len, 0, sizeof context_len);
|
| +
|
| + deallocate_var_all ();
|
| }
|
|
|
| void
|
| @@ -661,74 +661,6 @@ hb_buffer_t::guess_segment_properties (void)
|
| }
|
|
|
|
|
| -static inline void
|
| -dump_var_allocation (const hb_buffer_t *buffer)
|
| -{
|
| - char buf[80];
|
| - for (unsigned int i = 0; i < 8; i++)
|
| - buf[i] = '0' + buffer->allocated_var_bytes[7 - i];
|
| - buf[8] = '\0';
|
| - DEBUG_MSG (BUFFER, buffer,
|
| - "Current var allocation: %s",
|
| - buf);
|
| -}
|
| -
|
| -void hb_buffer_t::allocate_var (unsigned int byte_i, unsigned int count, const char *owner)
|
| -{
|
| - assert (byte_i < 8 && byte_i + count <= 8);
|
| -
|
| - if (DEBUG_ENABLED (BUFFER))
|
| - dump_var_allocation (this);
|
| - DEBUG_MSG (BUFFER, this,
|
| - "Allocating var bytes %d..%d for %s",
|
| - byte_i, byte_i + count - 1, owner);
|
| -
|
| - for (unsigned int i = byte_i; i < byte_i + count; i++) {
|
| - assert (!allocated_var_bytes[i]);
|
| - allocated_var_bytes[i]++;
|
| - allocated_var_owner[i] = owner;
|
| - }
|
| -}
|
| -
|
| -void hb_buffer_t::deallocate_var (unsigned int byte_i, unsigned int count, const char *owner)
|
| -{
|
| - if (DEBUG_ENABLED (BUFFER))
|
| - dump_var_allocation (this);
|
| -
|
| - DEBUG_MSG (BUFFER, this,
|
| - "Deallocating var bytes %d..%d for %s",
|
| - byte_i, byte_i + count - 1, owner);
|
| -
|
| - assert (byte_i < 8 && byte_i + count <= 8);
|
| - for (unsigned int i = byte_i; i < byte_i + count; i++) {
|
| - assert (allocated_var_bytes[i]);
|
| - assert (0 == strcmp (allocated_var_owner[i], owner));
|
| - allocated_var_bytes[i]--;
|
| - }
|
| -}
|
| -
|
| -void hb_buffer_t::assert_var (unsigned int byte_i, unsigned int count, const char *owner)
|
| -{
|
| - if (DEBUG_ENABLED (BUFFER))
|
| - dump_var_allocation (this);
|
| -
|
| - DEBUG_MSG (BUFFER, this,
|
| - "Asserting var bytes %d..%d for %s",
|
| - byte_i, byte_i + count - 1, owner);
|
| -
|
| - assert (byte_i < 8 && byte_i + count <= 8);
|
| - for (unsigned int i = byte_i; i < byte_i + count; i++) {
|
| - assert (allocated_var_bytes[i]);
|
| - assert (0 == strcmp (allocated_var_owner[i], owner));
|
| - }
|
| -}
|
| -
|
| -void hb_buffer_t::deallocate_var_all (void)
|
| -{
|
| - memset (allocated_var_bytes, 0, sizeof (allocated_var_bytes));
|
| - memset (allocated_var_owner, 0, sizeof (allocated_var_owner));
|
| -}
|
| -
|
| /* Public API */
|
|
|
| /**
|
|
|