提交 d16ccc4a 编写于 作者: B Behdad Esfahbod

Leave one extra item at the end of buffer allocation

Just in case, for the times we do out-of-bounds access.

jk
上级 075d671f
...@@ -148,7 +148,7 @@ struct hb_buffer_t { ...@@ -148,7 +148,7 @@ struct hb_buffer_t {
HB_INTERNAL bool enlarge (unsigned int size); HB_INTERNAL bool enlarge (unsigned int size);
inline bool ensure (unsigned int size) inline bool ensure (unsigned int size)
{ return likely (size <= allocated) ? true : enlarge (size); } { return likely (size < allocated) ? true : enlarge (size); }
HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册