|
96 | 96 | # define rb_num2int rb_num2int_stub |
97 | 97 | #endif |
98 | 98 |
|
| 99 | +# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21 |
| 100 | +/* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses |
| 101 | + * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC */ |
| 102 | +# define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub |
| 103 | +# endif |
| 104 | + |
99 | 105 | #include <ruby.h> |
100 | 106 | #ifdef RUBY19_OR_LATER |
101 | 107 | # include <ruby/encoding.h> |
@@ -373,6 +379,10 @@ static VALUE (*dll_rb_require) (const char*); |
373 | 379 | static void* (*ruby_process_options)(int, char**); |
374 | 380 | # endif |
375 | 381 |
|
| 382 | +# if defined(USE_RGENGC) && USE_RGENGC |
| 383 | +static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE); |
| 384 | +# endif |
| 385 | + |
376 | 386 | # if defined(RUBY19_OR_LATER) && !defined(PROTO) |
377 | 387 | SIGNED_VALUE rb_num2long_stub(VALUE x) |
378 | 388 | { |
@@ -406,6 +416,13 @@ VALUE rb_num2ulong(VALUE x) |
406 | 416 | # endif |
407 | 417 | # endif |
408 | 418 |
|
| 419 | +# if defined(USE_RGENGC) && USE_RGENGC |
| 420 | +void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj) |
| 421 | +{ |
| 422 | + return dll_rb_gc_writebarrier_unprotect_promoted(obj); |
| 423 | +} |
| 424 | +# endif |
| 425 | + |
409 | 426 | static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */ |
410 | 427 |
|
411 | 428 | /* |
@@ -520,6 +537,9 @@ static struct |
520 | 537 | {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, |
521 | 538 | # endif |
522 | 539 | {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, |
| 540 | +# endif |
| 541 | +# if defined(USE_RGENGC) && USE_RGENGC |
| 542 | + {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted}, |
523 | 543 | # endif |
524 | 544 | {"", NULL}, |
525 | 545 | }; |
|
0 commit comments