summaryrefslogtreecommitdiff
path: root/ext/json/generator/generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/generator/generator.c')
-rw-r--r--ext/json/generator/generator.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index baf5360bb17..a135e283482 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -526,16 +526,11 @@ static const rb_data_type_t JSON_Generator_State_type = {
};
#endif
-static JSON_Generator_State *State_allocate(void)
-{
- JSON_Generator_State *state = ZALLOC(JSON_Generator_State);
- return state;
-}
-
static VALUE cState_s_allocate(VALUE klass)
{
- JSON_Generator_State *state = State_allocate();
- return TypedData_Wrap_Struct(klass, &JSON_Generator_State_type, state);
+ JSON_Generator_State *state;
+ return TypedData_Make_Struct(klass, JSON_Generator_State,
+ &JSON_Generator_State_type, state);
}
/*