Пример #1
0
Файл: gc.c Проект: cyisfor/ponyc
void ponyint_gc_markobject(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)
    mark_local_object(ctx, chunk, p, f);
  else
    mark_remote_object(ctx, actor, p, f, immutable, chunk);
}
Пример #2
0
void ponyint_gc_markobject(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)
    mark_local_object(ctx, chunk, p, t, mutability);
  else
    mark_remote_object(ctx, actor, p, t, mutability);
}