Project

General

Profile

Feature #2294 ยป ruby_bind_stack.patch

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

View differences:

ChangeLog
35 35

  
36 36
	* io.c (io_cntl): F_DUPFD is platform dependent.
37 37

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

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

  
42
	* gc.c: implement ruby_bind_stack().  narrow GC scanning region
43
	  to ruby_bind_stack() boundaries in mark_current_machine_context().
44

  
38 45
Sun Oct 25 10:19:09 2009  Nobuyoshi Nakada  <nobu@ruby-lang.org>
39 46

  
40 47
	* ext/dl/handle.c (rb_dlhandle_close): fixed an invalid local
gc.c
2088 2088

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

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

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

  
2091 2101
static void
2092 2102
mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
2093 2103
{
......
2120 2130
			 (VALUE*)save_regs_gc_mark,
2121 2131
			 sizeof(save_regs_gc_mark) / sizeof(VALUE));
2122 2132

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

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

  
2123 2141
    rb_gc_mark_locations(stack_start, stack_end);
2124 2142
#ifdef __ia64
2125 2143
    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
-