* 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
Родитель 5abe0a9b69
Коммит dd15b0555b
2 изменённых файлов: 15 добавлений и 11 удалений

Просмотреть файл

@ -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.>
* rubytest.rb: set dldpath on darwin.

17
gc.c
Просмотреть файл

@ -384,10 +384,10 @@ static unsigned int STACK_LEVEL_MAX = 655300;
#elif STACK_GROW_DIRECTION < 0
# define STACK_LENGTH (rb_gc_stack_start - STACK_END)
#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
# 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
#if STACK_GROW_DIRECTION > 0
# define STACK_UPPER(x, a, b) a
@ -564,11 +564,6 @@ rb_gc_mark_locations(start, end)
VALUE *tmp;
long n;
if (start > end) {
tmp = start;
start = end;
end = tmp;
}
n = end - start;
mark_locations_array(start,n);
}
@ -1247,12 +1242,12 @@ rb_gc()
#if STACK_GROW_DIRECTION < 0
rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start);
#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
if ((VALUE*)STACK_END < rb_gc_stack_start)
rb_gc_mark_locations((VALUE*)STACK_END, rb_gc_stack_start);
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
#ifdef __ia64__
/* mark backing store (flushed register window on the stack) */
@ -1319,7 +1314,7 @@ Init_stack(addr)
if (!addr) addr = (VALUE *)&addr;
if (rb_gc_stack_start) {
if (STACK_UPPER(&addr,
rb_gc_stack_start > --addr,
rb_gc_stack_start > addr,
rb_gc_stack_start < ++addr))
rb_gc_stack_start = addr;
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++) {
p = heaps[i]; pend = p + heaps_limits[i];
while (p < pend) {