예제 #1
0
파일: gc.c 프로젝트: cyisfor/ponyc
void ponyint_gc_sendobject(pony_ctx_t* ctx, void* p, pony_trace_fn f,
  bool immutable)
{
  chunk_t* chunk = (chunk_t*)ponyint_pagemap_get(p);

  // Don't gc memory that wasn't pony_allocated, but do recurse.
  if(chunk == NULL)
  {
    recurse(ctx, p, f);
    return;
  }

  pony_actor_t* actor = ponyint_heap_owner(chunk);

  if(actor == ctx->current)
    send_local_object(ctx, p, f, immutable);
  else
    send_remote_object(ctx, actor, p, f, immutable);
}
예제 #2
0
파일: gc.c 프로젝트: killerswan/ponyc
void ponyint_gc_sendobject(pony_ctx_t* ctx, void* p, pony_type_t* t,
  int mutability)
{
  chunk_t* chunk = (chunk_t*)ponyint_pagemap_get(p);

  // Don't gc memory that wasn't pony_allocated, but do recurse.
  if(chunk == NULL)
  {
    if(mutability != PONY_TRACE_OPAQUE)
      recurse(ctx, p, t->trace);
    return;
  }

  pony_actor_t* actor = ponyint_heap_owner(chunk);

  if(actor == ctx->current)
    send_local_object(ctx, p, t, mutability);
  else
    send_remote_object(ctx, actor, p, t, mutability);
}