Skip to content

Commit c894346

Browse files
committed
ruby: call RUBY_INIT_STACK
1 parent d75c01b commit c894346

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

plugins/ruby/ruby.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ typedef unsigned long ID;
293293
#define FIX2INT(i) (((long)i) >> 1)
294294
#define RUBY_METHOD_FUNC(func) ((VALUE(*)(...))func)
295295

296+
void (*ruby_init_stack)(VALUE*);
296297
void (*ruby_sysinit)(int *, const char ***);
297298
void (*ruby_init)(void);
298299
void (*ruby_init_loadpath)(void);
@@ -337,6 +338,7 @@ static int df_loadruby(void)
337338
// ruby_sysinit is optional (ruby1.9 only)
338339
ruby_sysinit = (decltype(ruby_sysinit))LookupPlugin(libruby_handle, "ruby_sysinit");
339340
#define rbloadsym(s) if (!(s = (decltype(s))LookupPlugin(libruby_handle, #s))) return 0
341+
rbloadsym(ruby_init_stack);
340342
rbloadsym(ruby_init);
341343
rbloadsym(ruby_init_loadpath);
342344
rbloadsym(ruby_script);
@@ -401,6 +403,10 @@ static void df_rubythread(void *p)
401403
{
402404
int state, running;
403405

406+
// may need to be run from df main thread?
407+
VALUE foo;
408+
ruby_init_stack(&foo);
409+
404410
if (ruby_sysinit) {
405411
// ruby1.9 specific API
406412
static int argc;

0 commit comments

Comments
 (0)