Permalink
Browse files

merged revision(s) 37075,37076,37082,37083,37088: [Backport #7123]

* gc.c: Use the non-recursive marking instead of recursion. The
  recursion marking of CRuby needs checking stack overflow and the
  fail-safe system, but these systems not good at partial points,
  for example, marking deep tree structures. [ruby-dev:46184]
  [Feature #7095]

* configure.in (GC_MARK_STACKFRAME_WORD): removed. It's used by
  checking stack overflow of marking.

* win32/Makefile.sub (GC_MARK_STACKFRAME_WORD): ditto.

* gc.c (free_stack_chunks): it is used only when per-VM object space
  is enabled.

* gc.c (rb_objspace_call_finalizer): mark self-referencing finalizers
  before run finalizers, to fix SEGV from btest on 32bit.

* gc.c (gc_mark_stacked_objects): extract from gc_marks().

* gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objects
  at suitable point.

* gc.c (init_heap): call init_mark_stack before to allocate
  altstack. This change avoid the stack overflow at the signal
  handler on 32bit, but I don't understand reason... [Feature #7095]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 28a3dae commit ae2df330bc7662a50bea6385e53d49078592b07e @unak unak committed Nov 13, 2012
Showing with 256 additions and 199 deletions.
  1. +28 −0 ChangeLog
  2. +0 −57 configure.in
  3. +225 −138 gc.c
  4. +3 −3 version.h
  5. +0 −1 win32/Makefile.sub
View
@@ -1,3 +1,31 @@
+Tue Nov 13 18:13:10 2012 Narihiro Nakamura <authornari@gmail.com>
+
+ * gc.c: Use the non-recursive marking instead of recursion. The
+ recursion marking of CRuby needs checking stack overflow and the
+ fail-safe system, but these systems not good at partial points,
+ for example, marking deep tree structures. [ruby-dev:46184]
+ [Feature #7095]
+
+ * configure.in (GC_MARK_STACKFRAME_WORD): removed. It's used by
+ checking stack overflow of marking.
+
+ * win32/Makefile.sub (GC_MARK_STACKFRAME_WORD): ditto.
+
+ * gc.c (free_stack_chunks): it is used only when per-VM object space
+ is enabled.
+
+ * gc.c (rb_objspace_call_finalizer): mark self-referencing finalizers
+ before run finalizers, to fix SEGV from btest on 32bit.
+
+ * gc.c (gc_mark_stacked_objects): extract from gc_marks().
+
+ * gc.c (rb_objspace_call_finalizer): call gc_mark_stacked_objects
+ at suitable point.
+
+ * gc.c (init_heap): call init_mark_stack before to allocate
+ altstack. This change avoid the stack overflow at the signal
+ handler on 32bit, but I don't understand reason... [Feature #7095]
+
Sat Nov 10 01:25:52 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (append_fspath): no need to do encoding trick here.
View
@@ -1268,63 +1268,6 @@ if test $rb_cv_stack_end_address != no; then
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
fi
-AC_CACHE_CHECK(for gc_mark and gc_children stack frame approximate size(word), rb_cv_gc_mark_stackframe_word,
-[save_CFLAGS="$CFLAGS"
-CFLAGS="-O0"
-AC_TRY_RUN([
-int word;
-char *stack_start;
-
-void
-set_stackframe_word()
-{
- int dumy = 42;
- int diff;
-
- if (stack_start < (char *)&dumy) {
- diff = (int)((char *)&dumy - stack_start);
- }
- else {
- diff = (int)(stack_start - (char *)&dumy);
- }
- word = (diff/sizeof(void *));
- if ((diff % sizeof(void *)) != 0) {
- word++;
- }
-}
-
-void
-gc_mark_children(void *p1, void *p2, int lev)
-{
- void *obj = p2;
-
- set_stackframe_word(p1,p2,lev);
-}
-
-void
-gc_mark(void *p1, void *p2, int lev)
-{
- void *obj = p2;
-
- gc_mark_children(p1,p2,lev++);
-}
-
-int
-main() {
- int dumy = 42;
-
- stack_start = (char *)&dumy;
- gc_mark(0, 0, 255);
- return word;
-}
-],
- [rb_cv_gc_mark_stackframe_word="$?"],
- [rb_cv_gc_mark_stackframe_word="$?"],
- [rb_cv_gc_mark_stackframe_word="30"])
-CFLAGS="$save_CFLAGS"])
-AC_DEFINE_UNQUOTED(GC_MARK_STACKFRAME_WORD, $rb_cv_gc_mark_stackframe_word)
-
-
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
Oops, something went wrong.

0 comments on commit ae2df33

Please sign in to comment.