* gc.c (rb_gc_mark_locations): no need to swap arguments.

* gc.c (STACK_LENGTH): insufficient for growing up stack
  architectures.

* gc.c (rb_gc, Init_stack) ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-08-01 14:57:48 +00:00
parent 5abe0a9b69
commit dd15b0555b
2 changed files with 15 additions and 11 deletions

View File

@ -1,3 +1,12 @@
Fri Aug 1 23:57:45 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (rb_gc_mark_locations): no need to swap arguments.
* gc.c (STACK_LENGTH): insufficient for growing up stack
architectures.
* gc.c (rb_gc, Init_stack) ditto.
Fri Aug 1 23:33:36 2003 Masatoshi Seki <mas@snow.local.> Fri Aug 1 23:33:36 2003 Masatoshi Seki <mas@snow.local.>
* rubytest.rb: set dldpath on darwin. * rubytest.rb: set dldpath on darwin.

17
gc.c
View File

@ -384,10 +384,10 @@ static unsigned int STACK_LEVEL_MAX = 655300;
#elif STACK_GROW_DIRECTION < 0 #elif STACK_GROW_DIRECTION < 0
# define STACK_LENGTH (rb_gc_stack_start - STACK_END) # define STACK_LENGTH (rb_gc_stack_start - STACK_END)
#elif STACK_GROW_DIRECTION > 0 #elif STACK_GROW_DIRECTION > 0
# define STACK_LENGTH (STACK_END - rb_gc_stack_start) # define STACK_LENGTH (STACK_END - rb_gc_stack_start + 1)
#else #else
# define STACK_LENGTH ((STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END\ # define STACK_LENGTH ((STACK_END < rb_gc_stack_start) ? rb_gc_stack_start - STACK_END\
: STACK_END - rb_gc_stack_start) : STACK_END - rb_gc_stack_start + 1)
#endif #endif
#if STACK_GROW_DIRECTION > 0 #if STACK_GROW_DIRECTION > 0
# define STACK_UPPER(x, a, b) a # define STACK_UPPER(x, a, b) a
@ -564,11 +564,6 @@ rb_gc_mark_locations(start, end)
VALUE *tmp; VALUE *tmp;
long n; long n;
if (start > end) {
tmp = start;
start = end;
end = tmp;
}
n = end - start; n = end - start;
mark_locations_array(start,n); mark_locations_array(start,n);
} }
@ -1247,12 +1242,12 @@ rb_gc()
#if STACK_GROW_DIRECTION < 0 #if STACK_GROW_DIRECTION < 0
rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start); rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start);
#elif STACK_GROW_DIRECTION > 0 #elif STACK_GROW_DIRECTION > 0
rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END); rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END + 1);
#else #else
if ((VALUE*)STACK_END < rb_gc_stack_start) if ((VALUE*)STACK_END < rb_gc_stack_start)
rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start); rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start);
else else
rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END); rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END + 1);
#endif #endif
#ifdef __ia64__ #ifdef __ia64__
/* mark backing store (flushed register window on the stack) */ /* mark backing store (flushed register window on the stack) */
@ -1319,7 +1314,7 @@ Init_stack(addr)
if (!addr) addr = (VALUE *)&addr; if (!addr) addr = (VALUE *)&addr;
if (rb_gc_stack_start) { if (rb_gc_stack_start) {
if (STACK_UPPER(&addr, if (STACK_UPPER(&addr,
rb_gc_stack_start > --addr, rb_gc_stack_start > addr,
rb_gc_stack_start < ++addr)) rb_gc_stack_start < ++addr))
rb_gc_stack_start = addr; rb_gc_stack_start = addr;
return; return;
@ -1597,7 +1592,7 @@ rb_gc_call_finalizer_at_exit()
} }
} }
} }
/* run data object's finaliers */ /* run data object's finalizers */
for (i = 0; i < heaps_used; i++) { for (i = 0; i < heaps_used; i++) {
p = heaps[i]; pend = p + heaps_limits[i]; p = heaps[i]; pend = p + heaps_limits[i];
while (p < pend) { while (p < pend) {