[前][次][番号順一覧][スレッド一覧]

ruby-changes:7366

From: akr <ko1@a...>
Date: Thu, 28 Aug 2008 02:22:20 +0900 (JST)
Subject: [ruby-changes:7366] Ruby:r18885 (trunk): * include/ruby/io.h (rb_io_t): refcnt field removed.

akr	2008-08-28 02:19:19 +0900 (Thu, 28 Aug 2008)

  New Revision: 18885

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18885

  Log:
    * include/ruby/io.h (rb_io_t): refcnt field removed.
      (MakeOpenFile): refcnt initialization removed.
    
    * io.c (rb_io_fptr_finalize): don't check refcnt.
      (rb_io_close_read): don't use refcnt.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/io.h
    trunk/io.c

Index: include/ruby/io.h
===================================================================
--- include/ruby/io.h	(revision 18884)
+++ include/ruby/io.h	(revision 18885)
@@ -35,7 +35,6 @@
     int lineno;			/* number of lines read */
     VALUE pathv;			/* pathname for file */
     void (*finalize)(struct rb_io_t*,int); /* finalize proc */
-    long refcnt;
 
     char *wbuf;                 /* wbuf_off + wbuf_len <= wbuf_capa */
     int wbuf_off;
@@ -109,7 +108,6 @@
     fp->lineno = 0;\
     fp->pathv = Qnil;\
     fp->finalize = 0;\
-    fp->refcnt = 1;\
     fp->wbuf = NULL;\
     fp->wbuf_off = 0;\
     fp->wbuf_len = 0;\
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18884)
+++ ChangeLog	(revision 18885)
@@ -1,3 +1,11 @@
+Thu Aug 28 02:16:49 2008  Tanaka Akira  <akr@f...>
+
+	* include/ruby/io.h (rb_io_t): refcnt field removed.
+	  (MakeOpenFile): refcnt initialization removed.
+
+	* io.c (rb_io_fptr_finalize): don't check refcnt.
+	  (rb_io_close_read): don't use refcnt.
+
 Thu Aug 28 00:07:59 2008  Tanaka Akira  <akr@f...>
 
 	* io.c (rb_io_initialize): don't accept IO object.  [ruby-dev:35895]
Index: io.c
===================================================================
--- io.c	(revision 18884)
+++ io.c	(revision 18885)
@@ -3105,7 +3105,6 @@
 rb_io_fptr_finalize(rb_io_t *fptr)
 {
     if (!fptr) return 0;
-    if (fptr->refcnt <= 0 || --fptr->refcnt) return 0;
     fptr->pathv = Qnil;
     if (0 <= fptr->fd)
 	rb_io_fptr_cleanup(fptr, Qtrue);
@@ -3275,11 +3274,9 @@
 	rb_io_t *wfptr;
         fptr_finalize(fptr, Qfalse);
 	GetOpenFile(write_io, wfptr);
-	if (fptr->refcnt < LONG_MAX) {
-	    wfptr->refcnt++;
-	    RFILE(io)->fptr = wfptr;
-	    rb_io_fptr_finalize(fptr);
-	}
+        RFILE(io)->fptr = wfptr;
+        RFILE(write_io)->fptr = NULL;
+        rb_io_fptr_finalize(fptr);
         return Qnil;
     }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]