From 7b863142ceb82fc2fd23802f19f7379aa2f152e5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 3 Apr 2019 15:48:27 -0700 Subject: [PATCH] [serialize] Make putting breakpoint on out-of-memory easier --- src/hb-serialize.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index e1c283c1e..0d908bd13 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -323,6 +323,9 @@ struct hb_serialize_context_t return ret; } + void + err_ran_out_of_room () { this->ran_out_of_room = true; } + template Type *allocate_size (unsigned int size) { @@ -330,7 +333,7 @@ struct hb_serialize_context_t if (this->tail - this->head < ptrdiff_t (size)) { - this->ran_out_of_room = true; + err_ran_out_of_room (); this->successful = false; return nullptr; }