Example #1
0
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);
}
Example #2
0
File: trace.c Project: enigma/ponyc
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);
}
Example #3
0
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));
}
Example #4
0
File: trace.c Project: enigma/ponyc
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);
}
Example #5
0
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
}
Example #6
0
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;
}
Example #7
0
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));
}
Example #8
0
void pony_acquire_done(pony_ctx_t* ctx)
{
  ponyint_gc_handlestack(ctx);
  ponyint_gc_sendacquire(ctx);
  ponyint_gc_done(ponyint_actor_gc(ctx->current));
}
Example #9
0
File: trace.c Project: enigma/ponyc
void pony_send_next(pony_ctx_t* ctx)
{
  ponyint_gc_handlestack(ctx);
  ponyint_gc_done(ponyint_actor_gc(ctx->current));
}