Project

General

Profile

Feature #2294 » ruby_bind_stack.patch

sunaku (Suraj Kurapati), 10/28/2009 02:02 AM

View differences:

ChangeLog
* io.c (io_cntl): F_DUPFD is platform dependent.
Mon Oct 25 13:28:00 2009 Suraj N. Kurapati <sunaku@gmail.com>
* include/ruby/ruby.h: declare ruby_bind_stack(). [ruby-core:26244]
* gc.c: implement ruby_bind_stack(). narrow GC scanning region
to ruby_bind_stack() boundaries in mark_current_machine_context().
Sun Oct 25 10:19:09 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dl/handle.c (rb_dlhandle_close): fixed an invalid local
gc.c
void rb_vm_mark(void *ptr);
static VALUE *ruby_stack_lower_bound = 0,
*ruby_stack_upper_bound = 0;
void
ruby_bind_stack(void *lower, void *upper)
{
ruby_stack_lower_bound = lower;
ruby_stack_upper_bound = upper;
}
static void
mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
{
......
(VALUE*)save_regs_gc_mark,
sizeof(save_regs_gc_mark) / sizeof(VALUE));
if (ruby_stack_lower_bound && stack_start < ruby_stack_lower_bound) {
stack_start = ruby_stack_lower_bound;
}
if (ruby_stack_upper_bound && stack_end > ruby_stack_upper_bound) {
stack_end = ruby_stack_upper_bound;
}
rb_gc_mark_locations(stack_start, stack_end);
#ifdef __ia64
rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
include/ruby/ruby.h
#define RUBY_INIT_STACK \
VALUE variable_in_this_stack_frame; \
ruby_init_stack(&variable_in_this_stack_frame);
void ruby_bind_stack(void *lower, void *upper);
void ruby_init(void);
void *ruby_options(int, char**);
int ruby_run_node(void *);
(1-1/26)