From cc95e346fd9cc26bb6fc3fb7b1082d7d011ef664 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sun, 20 Jun 2021 11:08:28 +0900 Subject: Added `MRB_OBJ_ALLOC()` macro that does not require a cast The `MRB_OBJ_ALLOC()` macro function returns a pointer of the type corresponding to the constant literal defined in `enum mrb_vtype`. --- src/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gc.c') diff --git a/src/gc.c b/src/gc.c index 96013da00..bcd0b29b6 100644 --- a/src/gc.c +++ b/src/gc.c @@ -295,7 +295,7 @@ MRB_API void* mrb_alloca(mrb_state *mrb, size_t size) { struct RString *s; - s = (struct RString*)mrb_obj_alloc(mrb, MRB_TT_STRING, mrb->string_class); + s = MRB_OBJ_ALLOC(mrb, MRB_TT_STRING, mrb->string_class); return s->as.heap.ptr = (char*)mrb_malloc(mrb, size); } -- cgit v1.2.3