Esempio n. 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);
}
Esempio n. 2
0
File: trace.c Progetto: 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);
}
Esempio n. 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));
}
Esempio n. 4
0
File: trace.c Progetto: 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);
}
Esempio n. 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
}
Esempio n. 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;
}
Esempio n. 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));
}
Esempio n. 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));
}
Esempio n. 9
0
File: trace.c Progetto: enigma/ponyc
void pony_send_next(pony_ctx_t* ctx)
{
  ponyint_gc_handlestack(ctx);
  ponyint_gc_done(ponyint_actor_gc(ctx->current));
}