summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-18 12:06:42 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-18 12:06:42 +0000
commit790a018902aa6d6aaa2a327875ee314ec219c97c (patch)
tree6d4afdf333976a87b4f0de7ef667c8e4603277f9 /gc.c
parentacf0203fbecb3edf0e5ec2f638836a05b9ce29cc (diff)
downloadruby-790a018902aa6d6aaa2a327875ee314ec219c97c.tar.gz
ruby-790a018902aa6d6aaa2a327875ee314ec219c97c.tar.xz
ruby-790a018902aa6d6aaa2a327875ee314ec219c97c.zip
* include/ruby/io.h (rb_io_t): new fields: writeconv,
writeconv_stateless and writeconv_initialized. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_econv_stateless_encoding): declared. (rb_econv_string): declared. * io.c (make_writeconv): new function. (io_fwrite): use econv. (make_readconv): fix error message. (finish_writeconv): new function. (fptr_finalize): call finish_writeconv. (clear_writeconv): new function. (clear_codeconv): new function to call both clear_readconv and clear_writeconv. (rb_io_fptr_finalize): call clear_codeconv instead of clear_readconv. (mode_enc): ditto. (io_set_encoding): ditto. (argf_next_argv): ditto. (io_encoding_set): ditto. * gc.c (gc_mark_children): mark writeconv_stateless in T_FILE. * transcode.c (stateless_encoding_i): new function. (rb_econv_stateless_encoding): ditto. (rb_econv_string): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 2bfb27d35..551437ac4 100644
--- a/gc.c
+++ b/gc.c
@@ -1507,8 +1507,10 @@ gc_mark_children(rb_objspace_t *objspace, VALUE ptr, int lev)
break;
case T_FILE:
- if (obj->as.file.fptr)
+ if (obj->as.file.fptr) {
gc_mark(objspace, obj->as.file.fptr->tied_io_for_writing, lev);
+ gc_mark(objspace, obj->as.file.fptr->writeconv_stateless, lev);
+ }
break;
case T_REGEXP: