mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.3.933
Problem: Ruby on Mac crashes due to GC failure. Solution: Init the stack from main(). (Hiroshi Shirosaki)
This commit is contained in:
@@ -144,6 +144,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int ruby_initialized = 0;
|
static int ruby_initialized = 0;
|
||||||
|
static void *ruby_stack_start;
|
||||||
static VALUE objtbl;
|
static VALUE objtbl;
|
||||||
|
|
||||||
static VALUE mVIM;
|
static VALUE mVIM;
|
||||||
@@ -226,6 +227,7 @@ static void ruby_vim_init(void);
|
|||||||
# define rb_float_new dll_rb_float_new
|
# define rb_float_new dll_rb_float_new
|
||||||
# define rb_ary_new dll_rb_ary_new
|
# define rb_ary_new dll_rb_ary_new
|
||||||
# define rb_ary_push dll_rb_ary_push
|
# define rb_ary_push dll_rb_ary_push
|
||||||
|
# define ruby_init_stack dll_ruby_init_stack
|
||||||
#else
|
#else
|
||||||
# define rb_str2cstr dll_rb_str2cstr
|
# define rb_str2cstr dll_rb_str2cstr
|
||||||
#endif
|
#endif
|
||||||
@@ -250,7 +252,6 @@ static void ruby_vim_init(void);
|
|||||||
# define rb_enc_str_new dll_rb_enc_str_new
|
# define rb_enc_str_new dll_rb_enc_str_new
|
||||||
# define rb_sprintf dll_rb_sprintf
|
# define rb_sprintf dll_rb_sprintf
|
||||||
# define rb_require dll_rb_require
|
# define rb_require dll_rb_require
|
||||||
# define ruby_init_stack dll_ruby_init_stack
|
|
||||||
# define ruby_process_options dll_ruby_process_options
|
# define ruby_process_options dll_ruby_process_options
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -335,6 +336,7 @@ static char * (*dll_rb_string_value_ptr) (volatile VALUE*);
|
|||||||
static VALUE (*dll_rb_float_new) (double);
|
static VALUE (*dll_rb_float_new) (double);
|
||||||
static VALUE (*dll_rb_ary_new) (void);
|
static VALUE (*dll_rb_ary_new) (void);
|
||||||
static VALUE (*dll_rb_ary_push) (VALUE, VALUE);
|
static VALUE (*dll_rb_ary_push) (VALUE, VALUE);
|
||||||
|
static void (*ruby_init_stack)(VALUE*);
|
||||||
#endif
|
#endif
|
||||||
#ifdef RUBY19_OR_LATER
|
#ifdef RUBY19_OR_LATER
|
||||||
static VALUE (*dll_rb_int2big)(SIGNED_VALUE);
|
static VALUE (*dll_rb_int2big)(SIGNED_VALUE);
|
||||||
@@ -347,7 +349,6 @@ static rb_encoding* (*dll_rb_enc_find) (const char*);
|
|||||||
static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
|
static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
|
||||||
static VALUE (*dll_rb_sprintf) (const char*, ...);
|
static VALUE (*dll_rb_sprintf) (const char*, ...);
|
||||||
static VALUE (*dll_rb_require) (const char*);
|
static VALUE (*dll_rb_require) (const char*);
|
||||||
static void (*ruby_init_stack)(VALUE*);
|
|
||||||
static void* (*ruby_process_options)(int, char**);
|
static void* (*ruby_process_options)(int, char**);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -475,6 +476,7 @@ static struct
|
|||||||
#endif
|
#endif
|
||||||
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||||
{"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr},
|
{"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr},
|
||||||
|
{"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
|
||||||
# if DYNAMIC_RUBY_VER <= 19
|
# if DYNAMIC_RUBY_VER <= 19
|
||||||
{"rb_float_new", (RUBY_PROC*)&dll_rb_float_new},
|
{"rb_float_new", (RUBY_PROC*)&dll_rb_float_new},
|
||||||
# else
|
# else
|
||||||
@@ -491,7 +493,6 @@ static struct
|
|||||||
{"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
|
{"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new},
|
||||||
{"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
|
{"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf},
|
||||||
{"rb_require", (RUBY_PROC*)&dll_rb_require},
|
{"rb_require", (RUBY_PROC*)&dll_rb_require},
|
||||||
{"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
|
|
||||||
{"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options},
|
{"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options},
|
||||||
#endif
|
#endif
|
||||||
{"", NULL},
|
{"", NULL},
|
||||||
@@ -716,8 +717,8 @@ static int ensure_ruby_initialized(void)
|
|||||||
NtInitialize(&argc, &argv);
|
NtInitialize(&argc, &argv);
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef RUBY19_OR_LATER
|
#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
|
||||||
RUBY_INIT_STACK;
|
ruby_init_stack(ruby_stack_start);
|
||||||
#endif
|
#endif
|
||||||
ruby_init();
|
ruby_init();
|
||||||
}
|
}
|
||||||
@@ -1389,3 +1390,9 @@ static void ruby_vim_init(void)
|
|||||||
rb_define_virtual_variable("$curbuf", buffer_s_current, 0);
|
rb_define_virtual_variable("$curbuf", buffer_s_current, 0);
|
||||||
rb_define_virtual_variable("$curwin", window_s_current, 0);
|
rb_define_virtual_variable("$curwin", window_s_current, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vim_ruby_init(void *stack_start)
|
||||||
|
{
|
||||||
|
/* should get machine stack start address early in main function */
|
||||||
|
ruby_stack_start = stack_start;
|
||||||
|
}
|
||||||
|
@@ -192,6 +192,13 @@ main
|
|||||||
params.window_count = -1;
|
params.window_count = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef FEAT_RUBY
|
||||||
|
{
|
||||||
|
int ruby_stack_start;
|
||||||
|
vim_ruby_init((void *)&ruby_stack_start);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TCL
|
#ifdef FEAT_TCL
|
||||||
vim_tcl_init(params.argv[0]);
|
vim_tcl_init(params.argv[0]);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -6,4 +6,5 @@ void ex_rubydo __ARGS((exarg_T *eap));
|
|||||||
void ex_rubyfile __ARGS((exarg_T *eap));
|
void ex_rubyfile __ARGS((exarg_T *eap));
|
||||||
void ruby_buffer_free __ARGS((buf_T *buf));
|
void ruby_buffer_free __ARGS((buf_T *buf));
|
||||||
void ruby_window_free __ARGS((win_T *win));
|
void ruby_window_free __ARGS((win_T *win));
|
||||||
|
void vim_ruby_init __ARGS((void *stack_start));
|
||||||
/* vim: set ft=c : */
|
/* vim: set ft=c : */
|
||||||
|
@@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
933,
|
||||||
/**/
|
/**/
|
||||||
932,
|
932,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user