summaryrefslogtreecommitdiffhomepage
path: root/src/hash.c
diff options
context:
space:
mode:
authordearblue <[email protected]>2021-06-20 11:08:28 +0900
committerdearblue <[email protected]>2021-06-20 11:08:28 +0900
commitcc95e346fd9cc26bb6fc3fb7b1082d7d011ef664 (patch)
tree63d154c95d0936ed7d22dd5294a6777a74b35d64 /src/hash.c
parentf678620a436aa015f9252858aa00112256ab0668 (diff)
downloadmruby-cc95e346fd9cc26bb6fc3fb7b1082d7d011ef664.tar.gz
mruby-cc95e346fd9cc26bb6fc3fb7b1082d7d011ef664.zip
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`.
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index 3b5d17761..2704be0c4 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -970,7 +970,7 @@ h_key_for(mrb_state *mrb, mrb_value key)
static struct RHash*
h_alloc(mrb_state *mrb)
{
- return (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class);
+ return MRB_OBJ_ALLOC(mrb, MRB_TT_HASH, mrb->hash_class);
}
static void