diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-29 17:34:08 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-29 17:34:08 +0000 |
commit | 24d2835e27f1c0a0ef09b5399888e455c975fb34 (patch) | |
tree | f157db528bfd7fddf106618208e572d0853d43cc | |
parent | 1b17df7bc1ee372420101c9845013cc01c1725af (diff) | |
download | ruby-24d2835e27f1c0a0ef09b5399888e455c975fb34.tar.gz |
* ext/syck/rubyext.c (syck_emitter_new): set buffer after
Data_Wrap_Struct to avoid possible GC. [ruby-talk:104835]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/syck/rubyext.c | 9 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Jun 30 02:41:10 2004 why the lucky stiff <why@ruby-lang.org> + + * ext/syck/rubyext.c (syck_emitter_new): set buffer after + Data_Wrap_Struct to avoid possible GC. [ruby-talk:104835] + Tue Jun 29 10:31:19 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (rb_eval_cmd, rb_thread_trap_eval): restore safe level. diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index c7c0ef1dbd..cdf184c432 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -907,7 +907,7 @@ syck_loader_initialize( self ) rb_hash_aset(families, rb_str_new2( YAML_DOMAIN ), rb_hash_new()); rb_hash_aset(families, rb_str_new2( RUBY_DOMAIN ), rb_hash_new()); - return self; + return self; } /* @@ -1286,14 +1286,13 @@ syck_emitter_new(argc, argv, class) { VALUE pobj, options, init_argv[1]; SyckEmitter *emitter = syck_new_emitter(); + rb_scan_args(argc, argv, "01", &options); + + pobj = Data_Wrap_Struct( class, syck_mark_emitter, syck_free_emitter, emitter ); syck_emitter_ignore_id( emitter, Qnil ); syck_emitter_handler( emitter, rb_syck_output_handler ); - emitter->bonus = (void *)rb_str_new2( "" ); - rb_scan_args(argc, argv, "01", &options); - pobj = Data_Wrap_Struct( class, syck_mark_emitter, syck_free_emitter, emitter ); - if ( ! rb_obj_is_instance_of( options, rb_cHash ) ) { options = rb_hash_new(); |