diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-21 03:08:33 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-21 03:08:33 +0000 |
commit | bfabc05a4375b84fa128af89337b1195248bd6da (patch) | |
tree | ae0c8f703dca2b6ae94a5b5518c736d373bca377 /gc.c | |
parent | 90ae99b0f0505f66a6fc1dfb7d7c631bf4bf76cc (diff) | |
download | ruby-bfabc05a4375b84fa128af89337b1195248bd6da.tar.gz |
* enum.c (enum_sort_by): do not use qsort directly. use
rb_ary_sort_bang() instead. [ruby-dev:24291]
* enum.c (enum_sort_by): pedantic type check added.
[ruby-dev:24291]
* hash.c (rb_hash_foreach_iter): check iter_lev after each
iteration. [ruby-dev:24289]
* array.c (rb_ary_and): element size might change during
comparison. [ruby-dev:24290]
* array.c (rb_ary_or): ditto. [ruby-dev:24292]
* array.c (rb_ary_equal): wrong fix. [ruby-dev:24286]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -39,10 +39,14 @@ */ #define __libc_ia64_register_backing_store_base (4ULL<<61) #else +#ifdef HAVE_UNWIND_H +#include <unwind.h> +#else #pragma weak __libc_ia64_register_backing_store_base extern unsigned long __libc_ia64_register_backing_store_base; #endif #endif +#endif #if defined _WIN32 || defined __CYGWIN__ #include <windows.h> @@ -610,6 +614,8 @@ mark_locations_array(x, n) register VALUE *x; register long n; { + VALUE tmp; + while (n--) { if (is_pointer_to_heap((void *)*x)) { gc_mark(*x, 0); @@ -1345,14 +1351,21 @@ rb_gc() { ucontext_t ctx; VALUE *top, *bot; +#ifdef HAVE_UNWIND_H + _Unwind_Context *unwctx = _UNW_createContextForSelf(); +#endif + getcontext(&ctx); mark_locations_array((VALUE*)&ctx.uc_mcontext, ((size_t)(sizeof(VALUE)-1 + sizeof ctx.uc_mcontext)/sizeof(VALUE))); - bot = (VALUE*)__libc_ia64_register_backing_store_base; -#if defined(__FreeBSD__) - top = (VALUE*)ctx.uc_mcontext.mc_special.bspstore; +#ifdef HAVE_UNWIND_H + _UNW_currentContext(unwctx); + bot = (VALUE*)(long)_UNW_getAR(unwctx, _UNW_AR_BSP); + top = (VALUE*)(long)_UNW_getAR(unwctx, _UNW_AR_BSPSTORE); + _UNW_destroyContext(unwctx); #else - top = (VALUE*)ctx.uc_mcontext.sc_ar_bsp; + bot = (VALUE*)__libc_ia64_register_backing_store_base; + top = (VALUE*)ctx.uc_mcontext.IA64_BSPSTORE; #endif rb_gc_mark_locations(bot, top); } |