Commit 2b588b85 authored by dearblue's avatar dearblue

Add NUL terminator to string object size calculation; ref #5032

parent 97f71b5a
......@@ -54,6 +54,7 @@ os_memsize_of_object(mrb_state* mrb, mrb_value obj)
size += mrb_objspace_page_slot_size();
if (!RSTR_EMBED_P(RSTRING(obj)) && !RSTR_SHARED_P(RSTRING(obj))) {
size += RSTRING_CAPA(obj);
size++; /* NUL terminator */
}
break;
case MRB_TT_CLASS:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment