From 68e2c7ecbd28afca66507306c4751481270fbf10 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 4 Jun 2014 23:16:57 -0700 Subject: add more garbage collection mitigation --- ext/ffi_yajl/ext/parser/parser.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext') diff --git a/ext/ffi_yajl/ext/parser/parser.c b/ext/ffi_yajl/ext/parser/parser.c index 9256469..8f9ccc0 100644 --- a/ext/ffi_yajl/ext/parser/parser.c +++ b/ext/ffi_yajl/ext/parser/parser.c @@ -170,6 +170,8 @@ static VALUE mParser_do_yajl_parse(VALUE self, VALUE str, VALUE opts) { /* hack to avoid garbage collection */ rb_ivar_set(self, rb_intern("stack"), ctx.stack); rb_ivar_set(self, rb_intern("key_stack"), ctx.key_stack); + rb_ivar_set(self, rb_intern("finished"), ctx.stack); + rb_ivar_set(self, rb_intern("key"), ctx.stack); hand = yajl_alloc(&callbacks, NULL, &ctx); if ((stat = yajl_parse(hand, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str))) != yajl_status_ok) { -- cgit v1.2.1