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

ruby-changes:8596

From: nobu <ko1@a...>
Date: Fri, 7 Nov 2008 20:43:12 +0900 (JST)
Subject: [ruby-changes:8596] Ruby:r20131 (mvm): * parse.y (Init_sym): symbol objectspace should not be GCed.

nobu	2008-11-07 20:42:51 +0900 (Fri, 07 Nov 2008)

  New Revision: 20131

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

  Log:
    * parse.y (Init_sym):  symbol objectspace should not be GCed.

  Modified files:
    branches/mvm/ChangeLog
    branches/mvm/common.mk
    branches/mvm/gc.c
    branches/mvm/gc.h
    branches/mvm/parse.y
    branches/mvm/signal.c
    branches/mvm/version.h

Index: mvm/ChangeLog
===================================================================
--- mvm/ChangeLog	(revision 20130)
+++ mvm/ChangeLog	(revision 20131)
@@ -1,3 +1,7 @@
+Fri Nov  7 20:42:47 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (Init_sym):  symbol objectspace should not be GCed.
+
 Tue Sep 16 05:04:56 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (rb_cv_thread_specific): check if no warnings.
Index: mvm/common.mk
===================================================================
--- mvm/common.mk	(revision 20130)
+++ mvm/common.mk	(revision 20131)
@@ -520,7 +520,7 @@
   {$(VPATH)}util.h {$(VPATH)}debug.h {$(VPATH)}node.h
 pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}st.h
 parse.$(OBJEXT): {$(VPATH)}parse.c {$(VPATH)}parse.y $(RUBY_H_INCLUDES) \
-  {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}encoding.h \
+  {$(VPATH)}st.h {$(VPATH)}node.h {$(VPATH)}encoding.h {$(VPATH)}gc.h \
   {$(VPATH)}oniguruma.h $(ID_H_INCLUDES) {$(VPATH)}regenc.h \
   {$(VPATH)}regex.h {$(VPATH)}util.h {$(VPATH)}lex.c {$(VPATH)}keywords \
   {$(VPATH)}debug.h {$(VPATH)}id.c
Index: mvm/gc.c
===================================================================
--- mvm/gc.c	(revision 20130)
+++ mvm/gc.c	(revision 20131)
@@ -691,9 +691,13 @@
 VALUE
 rb_gc_enable(void)
 {
-    rb_objspace_t *objspace = &rb_objspace;
+    return rb_objspace_gc_enable(&rb_objspace);
+}
+
+VALUE
+rb_objspace_gc_enable(rb_objspace_t *objspace)
+{
     int old = dont_gc;
-
     dont_gc = Qfalse;
     return old;
 }
@@ -713,9 +717,13 @@
 VALUE
 rb_gc_disable(void)
 {
-    rb_objspace_t *objspace = &rb_objspace;
+    return rb_objspace_gc_disable(&rb_objspace);
+}
+
+VALUE
+rb_objspace_gc_disable(rb_objspace_t *objspace)
+{
     int old = dont_gc;
-
     dont_gc = Qtrue;
     return old;
 }
Index: mvm/gc.h
===================================================================
--- mvm/gc.h	(revision 20130)
+++ mvm/gc.h	(revision 20131)
@@ -72,4 +72,10 @@
 # define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b)
 #endif
 
+struct rb_objspace;
+struct rb_objspace *rb_objspace_alloc(void);
+VALUE rb_objspace_gc_disable(struct rb_objspace *objspace);
+VALUE rb_objspace_gc_enable(struct rb_objspace *objspace);
+VALUE rb_newobj_from_heap(struct rb_objspace *objspace);
+
 #endif /* RUBY_GC_H */
Index: mvm/parse.y
===================================================================
--- mvm/parse.y	(revision 20130)
+++ mvm/parse.y	(revision 20131)
@@ -20,6 +20,7 @@
 #include "ruby/st.h"
 #include "ruby/encoding.h"
 #include "eval_intern.h"
+#include "gc.h"
 #include "id.h"
 #include "regenc.h"
 #include <stdio.h>
@@ -9094,7 +9095,7 @@
     st_table *id_str;
     VALUE op_sym[tLAST_TOKEN];
     rb_thread_lock_t lock;
-    struct rb_objspace_t *objspace;
+    struct rb_objspace *objspace;
 } global_symbols = {tLAST_ID};
 
 struct ivar_symbols {
@@ -9159,10 +9160,10 @@
 void
 Init_sym(void)
 {
-    struct rb_objspace_t *rb_objspace_alloc(void);
     ruby_native_thread_lock_initialize(&global_symbols.lock);
     ruby_native_thread_lock(&global_symbols.lock);
     global_symbols.objspace = rb_objspace_alloc();
+    rb_objspace_gc_disable(global_symbols.objspace);
     global_symbols.sym_id = st_init_table_with_size(&symhash, 1000);
     global_symbols.id_str = st_init_numtable_with_size(1000);
     Init_id();
@@ -9326,7 +9327,6 @@
 static VALUE
 sym_str_new(const char *name, long len, rb_encoding *enc)
 {
-    extern VALUE rb_newobj_from_heap(struct rb_objspace_t *);
     VALUE str = rb_newobj_from_heap(global_symbols.objspace);
 
     RSTRING(str)->basic.flags = T_STRING;
Index: mvm/version.h
===================================================================
--- mvm/version.h	(revision 20130)
+++ mvm/version.h	(revision 20131)
@@ -1,15 +1,15 @@
 #define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2008-09-16"
+#define RUBY_RELEASE_DATE "2008-11-07"
 #define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20080916
+#define RUBY_RELEASE_CODE 20081107
 #define RUBY_PATCHLEVEL 0
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 0
 #define RUBY_RELEASE_YEAR 2008
-#define RUBY_RELEASE_MONTH 9
-#define RUBY_RELEASE_DAY 16
+#define RUBY_RELEASE_MONTH 11
+#define RUBY_RELEASE_DAY 7
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: mvm/signal.c
===================================================================
--- mvm/signal.c	(revision 20130)
+++ mvm/signal.c	(revision 20131)
@@ -516,6 +516,10 @@
 # endif
 #endif
 
+#ifdef RUBY_DEBUG_ENV
+int ruby_enable_coredump = 0;
+#endif
+
 #if HAVE_PTHREAD_H
 #include <pthread.h>
 #endif
@@ -1049,10 +1053,6 @@
 }
 
 
-#ifdef RUBY_DEBUG_ENV
-int ruby_enable_coredump = 0;
-#endif
-
 /*
  * Many operating systems allow signals to be sent to running
  * processes. Some signals have a defined effect on the process, while

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

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