Skip to content

Commit

Permalink
Merge pull request #215 from dorkrawk/dorkrawk/undefine-allocate
Browse files Browse the repository at this point in the history
Add rb_undef_alloc_func for Parser and Encoder
  • Loading branch information
jhawthorn authored May 18, 2022
2 parents 100bf70 + d5771ab commit 158f39f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/yajl/yajl_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,7 @@ void Init_yajl() {
cStandardError = rb_const_get(rb_cObject, rb_intern("StandardError"));

cParser = rb_define_class_under(mYajl, "Parser", rb_cObject);
rb_undef_alloc_func(cParser);
rb_define_singleton_method(cParser, "new", rb_yajl_parser_new, -1);
rb_define_method(cParser, "initialize", rb_yajl_parser_init, -1);
rb_define_method(cParser, "parse", rb_yajl_parser_parse, -1);
Expand All @@ -1390,6 +1391,7 @@ void Init_yajl() {
rb_define_method(cProjector, "project", rb_yajl_projector_project, 1);

cEncoder = rb_define_class_under(mYajl, "Encoder", rb_cObject);
rb_undef_alloc_func(cEncoder);
rb_define_singleton_method(cEncoder, "new", rb_yajl_encoder_new, -1);
rb_define_method(cEncoder, "initialize", rb_yajl_encoder_init, -1);
rb_define_method(cEncoder, "encode", rb_yajl_encoder_encode, -1);
Expand Down

0 comments on commit 158f39f

Please sign in to comment.