diff --git a/ChangeLog b/ChangeLog index 3a25db8bea..faeb0d127a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Aug 1 19:48:56 2003 Yukihiro Matsumoto + + * ext/syck/rubyext.c (syck_emitter_write_m): forgot to declare + "self", making it default to "int". + + * ext/syck/rubyext.c (syck_emitter_simple_write): ditto. + + * gc.c (rb_gc): should mark backing store region on IA64. + Fri Aug 1 17:13:23 2003 Nobuyoshi Nakada * ext/openssl/extconf.rb: should replace literally. diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index cdef3a089a..1e6030b4bd 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -1104,11 +1104,11 @@ syck_emitter_flush_m( self ) */ VALUE syck_emitter_write_m( self, str ) - VALUE str; + VALUE self, str; { SyckEmitter *emitter; - Data_Get_Struct(self, SyckEmitter, emitter); + Data_Get_Struct(self, SyckEmitter, emitter); syck_emitter_write( emitter, RSTRING(str)->ptr, RSTRING(str)->len ); return self; } @@ -1118,11 +1118,11 @@ syck_emitter_write_m( self, str ) */ VALUE syck_emitter_simple_write( self, str ) - VALUE str; + VALUE self, str; { SyckEmitter *emitter; - Data_Get_Struct(self, SyckEmitter, emitter); + Data_Get_Struct(self, SyckEmitter, emitter); syck_emitter_simple( emitter, RSTRING(str)->ptr, RSTRING(str)->len ); return self; } diff --git a/gc.c b/gc.c index df8e22fb0f..792f70b7b4 100644 --- a/gc.c +++ b/gc.c @@ -30,6 +30,11 @@ #include #endif +#ifdef __ia64__ +#include +extern unsigned long __libc_ia64_register_backing_store_base; +#endif + void re_free_registers _((struct re_registers*)); void rb_io_fptr_finalize _((struct OpenFile*)); @@ -367,7 +372,7 @@ static unsigned int STACK_LEVEL_MAX = 655300; # define SET_STACK_END VALUE stack_end; alloca(0); # define STACK_END (&stack_end) #else -# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS) +# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS) && !defined(__ia64__) # define SET_STACK_END VALUE *stack_end = __builtin_frame_address(0) # else # define SET_STACK_END VALUE *stack_end = alloca(1) @@ -1236,7 +1241,7 @@ rb_gc() } FLUSH_REGISTER_WINDOWS; - /* This assumes that all registers are saved into the jmp_buf */ + /* This assumes that all registers are saved into the jmp_buf (and stack) */ setjmp(save_regs_gc_mark); mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *)); #if STACK_GROW_DIRECTION < 0 @@ -1249,6 +1254,20 @@ rb_gc() else rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END); #endif +#ifdef __ia64__ + /* mark backing store (flushed register window on the stack) */ + /* the basic idea from guile GC code */ + { + ucontext_t ctx; + VALUE *top, *bot; + getcontext(&ctx); + rb_gc_mark_locations((VALUE*)&ctx.uc_mcontext, + ((size_t)(sizeof(VALUE)-1 + sizeof ctx.uc_mcontext)/sizeof(VALUE))); + bot = (VALUE*)__libc_ia64_register_backing_store_base; + top = (VALUE*)ctx.uc_mcontext.sc_ar_bsp; + rb_gc_mark_locations(bot, top); + } +#endif #if defined(__human68k__) || defined(__mc68000__) rb_gc_mark_locations((VALUE*)((char*)STACK_END + 2), (VALUE*)((char*)rb_gc_stack_start + 2)); @@ -1322,7 +1341,7 @@ Init_stack(addr) /* ruby crashes on IA64 if compiled with optimizer on */ /* when if STACK_LEVEL_MAX is greater than this magic number */ /* I know this is a kludge. I suspect optimizer bug */ -#define IA64_MAGIC_STACK_LIMIT 32768 +#define IA64_MAGIC_STACK_LIMIT 49152 if (STACK_LEVEL_MAX > IA64_MAGIC_STACK_LIMIT) STACK_LEVEL_MAX = IA64_MAGIC_STACK_LIMIT; #endif