Project

General

Profile

Feature #2294 ยป ruby_bind_stack.patch

better description in changelog - sunaku (Suraj Kurapati), 10/28/2009 02:33 AM

View differences:

ChangeLog
121 121

  
122 122
	* io.c (io_cntl): F_DUPFD is platform dependent.
123 123

  
124
Mon Oct 25 13:28:00 2009  Suraj N. Kurapati <sunaku@gmail.com>
125

  
126
	* include/ruby/ruby.h: declare ruby_bind_stack(). [ruby-core:26244]
127

  
128
	* gc.c: implement ruby_bind_stack().  restrict GC marking region
129
	  to ruby_bind_stack() boundaries in mark_current_machine_context().
130

  
124 131
Sun Oct 25 10:19:09 2009  Nobuyoshi Nakada  <nobu@ruby-lang.org>
125 132

  
126 133
	* ext/dl/handle.c (rb_dlhandle_close): fixed an invalid local
gc.c
2089 2089

  
2090 2090
void rb_vm_mark(void *ptr);
2091 2091

  
2092
static VALUE *ruby_stack_lower_bound = 0,
2093
             *ruby_stack_upper_bound = 0;
2094

  
2095
void
2096
ruby_bind_stack(void *lower, void *upper)
2097
{
2098
    ruby_stack_lower_bound = lower;
2099
    ruby_stack_upper_bound = upper;
2100
}
2101

  
2092 2102
static void
2093 2103
mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
2094 2104
{
......
2121 2131
			 (VALUE*)save_regs_gc_mark,
2122 2132
			 sizeof(save_regs_gc_mark) / sizeof(VALUE));
2123 2133

  
2134
    if (ruby_stack_lower_bound && stack_start < ruby_stack_lower_bound) {
2135
      stack_start = ruby_stack_lower_bound;
2136
    }
2137

  
2138
    if (ruby_stack_upper_bound && stack_end > ruby_stack_upper_bound) {
2139
      stack_end = ruby_stack_upper_bound;
2140
    }
2141

  
2124 2142
    rb_gc_mark_locations(stack_start, stack_end);
2125 2143
#ifdef __ia64
2126 2144
    rb_gc_mark_locations(th->machine_register_stack_start, th->machine_register_stack_end);
include/ruby/ruby.h
1138 1138
#define RUBY_INIT_STACK \
1139 1139
    VALUE variable_in_this_stack_frame; \
1140 1140
    ruby_init_stack(&variable_in_this_stack_frame);
1141
void ruby_bind_stack(void *lower, void *upper);
1141 1142
void ruby_init(void);
1142 1143
void *ruby_options(int, char**);
1143 1144
int ruby_run_node(void *);
1144
-