void pony_serialise(pony_ctx_t* ctx, void* p, void* out) { // This can raise an error. assert(ctx->stack == NULL); ctx->trace_object = ponyint_serialise_object; ctx->trace_actor = ponyint_serialise_actor; ctx->serialise_size = 0; pony_traceunknown(ctx, p, PONY_TRACE_MUTABLE); ponyint_gc_handlestack(ctx); ponyint_array_t* r = (ponyint_array_t*)out; r->size = ctx->serialise_size; r->alloc = r->size; r->ptr = (char*)ponyint_pool_alloc_size(r->size); size_t i = HASHMAP_BEGIN; serialise_t* s; while((s = ponyint_serialise_next(&ctx->serialise, &i)) != NULL) { if(s->t != NULL) s->t->serialise(ctx, (void*)s->key, r->ptr, s->value, s->mutability); } serialise_cleanup(ctx); }
void pony_recv_done(pony_ctx_t* ctx) { ponyint_gc_handlestack(ctx); ponyint_gc_done(ponyint_actor_gc(ctx->current)); DTRACE1(GC_RECV_END, (uintptr_t)ctx->scheduler); }
void ponyint_mark_done(pony_ctx_t* ctx) { ponyint_gc_markimmutable(ctx, ponyint_actor_gc(ctx->current)); ponyint_gc_handlestack(ctx); ponyint_gc_sendacquire(ctx); ponyint_gc_sweep(ctx, ponyint_actor_gc(ctx->current)); ponyint_gc_done(ponyint_actor_gc(ctx->current)); }
void pony_send_done(pony_ctx_t* ctx) { ponyint_gc_handlestack(ctx); ponyint_gc_sendacquire(ctx); ponyint_gc_done(ponyint_actor_gc(ctx->current)); DTRACE1(GC_SEND_END, (uintptr_t)ctx->scheduler); }
void pony_recv_done(pony_ctx_t* ctx) { ponyint_gc_handlestack(ctx); ponyint_gc_done(ponyint_actor_gc(ctx->current)); #ifdef USE_TELEMETRY ctx->time_in_recv_scan += (ponyint_cpu_tick() - ctx->tsc); #endif }
void* pony_deserialise(pony_ctx_t* ctx, void* in) { // This can raise an error. ponyint_array_t* r = (ponyint_array_t*)in; ctx->serialise_buffer = r->ptr; ctx->serialise_size = r->size; void* object = pony_deserialise_offset(ctx, NULL, 0); ponyint_gc_handlestack(ctx); serialise_cleanup(ctx); return object; }
void pony_release_done(pony_ctx_t* ctx) { ponyint_gc_handlestack(ctx); ponyint_gc_sendrelease_manual(ctx); ponyint_gc_done(ponyint_actor_gc(ctx->current)); }
void pony_acquire_done(pony_ctx_t* ctx) { ponyint_gc_handlestack(ctx); ponyint_gc_sendacquire(ctx); ponyint_gc_done(ponyint_actor_gc(ctx->current)); }
void pony_send_next(pony_ctx_t* ctx) { ponyint_gc_handlestack(ctx); ponyint_gc_done(ponyint_actor_gc(ctx->current)); }