mrubyを超漢字で動作させる
修订版 | 2dcc2444fa7a6a332267fc4e06f487472133e0b0 (tree) |
---|---|
时间 | 2014-07-16 12:58:37 |
作者 | Yukihiro "Matz" Matsumoto <matz@ruby...> |
Commiter | Yukihiro "Matz" Matsumoto |
need to call write_barrier on every fiber context switch
@@ -279,7 +279,8 @@ fiber_transfer(mrb_state *mrb, mrb_value self) | ||
279 | 279 | mrb->c->status = MRB_FIBER_TRANSFERRED; |
280 | 280 | mrb->c = c; |
281 | 281 | c->status = MRB_FIBER_RUNNING; |
282 | - MARK_CONTEXT_MODIFY(c); | |
282 | + MARK_CONTEXT_MODIFY(c); | |
283 | + mrb_write_barrier(mrb, (struct RBasic*)c->fib); | |
283 | 284 | return fiber_result(mrb, a, len); |
284 | 285 | } |
285 | 286 |
@@ -310,6 +311,7 @@ mrb_fiber_yield(mrb_state *mrb, mrb_int len, const mrb_value *a) | ||
310 | 311 | mrb->c = c->prev; |
311 | 312 | c->prev = NULL; |
312 | 313 | MARK_CONTEXT_MODIFY(mrb->c); |
314 | + mrb_write_barrier(mrb, (struct RBasic*)c->fib); | |
313 | 315 | return fiber_result(mrb, a, len); |
314 | 316 | } |
315 | 317 |