@@ -241,6 +241,52 @@ static bool well_formed_msg_chain(pony_msg_t* first, pony_msg_t* last)
241
241
}
242
242
#endif
243
243
244
+ static void try_gc (pony_ctx_t * ctx , pony_actor_t * actor )
245
+ {
246
+ if (!ponyint_heap_startgc (& actor -> heap
247
+ #ifdef USE_RUNTIMESTATS
248
+ , actor ))
249
+ #else
250
+ ))
251
+ #endif
252
+ return ;
253
+
254
+ #ifdef USE_RUNTIMESTATS
255
+ uint64_t used_cpu = ponyint_sched_cpu_used (ctx );
256
+ ctx -> schedulerstats .misc_cpu += used_cpu ;
257
+ #endif
258
+
259
+ DTRACE1 (GC_START , (uintptr_t )ctx -> scheduler );
260
+
261
+ ponyint_gc_mark (ctx );
262
+
263
+ if (actor -> type -> trace != NULL )
264
+ actor -> type -> trace (ctx , actor );
265
+
266
+ ponyint_mark_done (ctx );
267
+
268
+ #ifdef USE_RUNTIMESTATS
269
+ used_cpu = ponyint_sched_cpu_used (ctx );
270
+ ctx -> schedulerstats .actor_gc_mark_cpu += used_cpu ;
271
+ actor -> actorstats .gc_mark_cpu += used_cpu ;
272
+ #endif
273
+
274
+ ponyint_heap_endgc (& actor -> heap
275
+ #ifdef USE_RUNTIMESTATS
276
+ , actor );
277
+ #else
278
+ );
279
+ #endif
280
+
281
+ DTRACE1 (GC_END , (uintptr_t )ctx -> scheduler );
282
+
283
+ #ifdef USE_RUNTIMESTATS
284
+ used_cpu = ponyint_sched_cpu_used (ctx );
285
+ ctx -> schedulerstats .actor_gc_sweep_cpu += used_cpu ;
286
+ actor -> actorstats .gc_sweep_cpu += used_cpu ;
287
+ #endif
288
+ }
289
+
244
290
static void send_unblock (pony_actor_t * actor )
245
291
{
246
292
// Send unblock before continuing.
@@ -462,52 +508,6 @@ static bool handle_message(pony_ctx_t* ctx, pony_actor_t* actor,
462
508
}
463
509
}
464
510
465
- static void try_gc (pony_ctx_t * ctx , pony_actor_t * actor )
466
- {
467
- if (!ponyint_heap_startgc (& actor -> heap
468
- #ifdef USE_RUNTIMESTATS
469
- , actor ))
470
- #else
471
- ))
472
- #endif
473
- return ;
474
-
475
- #ifdef USE_RUNTIMESTATS
476
- uint64_t used_cpu = ponyint_sched_cpu_used (ctx );
477
- ctx -> schedulerstats .misc_cpu += used_cpu ;
478
- #endif
479
-
480
- DTRACE1 (GC_START , (uintptr_t )ctx -> scheduler );
481
-
482
- ponyint_gc_mark (ctx );
483
-
484
- if (actor -> type -> trace != NULL )
485
- actor -> type -> trace (ctx , actor );
486
-
487
- ponyint_mark_done (ctx );
488
-
489
- #ifdef USE_RUNTIMESTATS
490
- used_cpu = ponyint_sched_cpu_used (ctx );
491
- ctx -> schedulerstats .actor_gc_mark_cpu += used_cpu ;
492
- actor -> actorstats .gc_mark_cpu += used_cpu ;
493
- #endif
494
-
495
- ponyint_heap_endgc (& actor -> heap
496
- #ifdef USE_RUNTIMESTATS
497
- , actor );
498
- #else
499
- );
500
- #endif
501
-
502
- DTRACE1 (GC_END , (uintptr_t )ctx -> scheduler );
503
-
504
- #ifdef USE_RUNTIMESTATS
505
- used_cpu = ponyint_sched_cpu_used (ctx );
506
- ctx -> schedulerstats .actor_gc_sweep_cpu += used_cpu ;
507
- actor -> actorstats .gc_sweep_cpu += used_cpu ;
508
- #endif
509
- }
510
-
511
511
// return true if mute occurs
512
512
static bool maybe_should_mute (pony_actor_t * actor )
513
513
{
0 commit comments