Hides the class of string objects allocated by mrb_alloca()

Prevents retrieval with the `ObjectSpace.each_object` method.
This commit is contained in:
dearblue
2022-04-23 22:13:30 +09:00
parent a4d97934d5
commit 889f1b898f
+1 -1
View File
@@ -293,7 +293,7 @@ MRB_API void*
mrb_alloca(mrb_state *mrb, size_t size)
{
struct RString *s;
s = MRB_OBJ_ALLOC(mrb, MRB_TT_STRING, mrb->string_class);
s = MRB_OBJ_ALLOC(mrb, MRB_TT_STRING, NULL);
return s->as.heap.ptr = (char*)mrb_malloc(mrb, size);
}