mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add NUL terminator to string object size calculation; ref #5032
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user