コード例 #1
0
ファイル: gc.c プロジェクト: cyisfor/ponyc
static void mark_local_object(pony_ctx_t* ctx, chunk_t* chunk, void* p,
  pony_trace_fn f)
{
  if(f != NULL)
  {
    // Mark in our heap and recurse if it wasn't already marked.
    if(!ponyint_heap_mark(chunk, p))
      recurse(ctx, p, f);
  } else {
    // No recurse function, so do a shallow mark. If the same address is
    // later marked with a recurse function, it will recurse.
    ponyint_heap_mark_shallow(chunk, p);
  }
}
コード例 #2
0
ファイル: gc.c プロジェクト: killerswan/ponyc
static void mark_local_object(pony_ctx_t* ctx, chunk_t* chunk, void* p,
  pony_type_t* t, int mutability)
{
  if(mutability != PONY_TRACE_OPAQUE)
  {
    // Mark in our heap and recurse if it wasn't already marked.
    if(!ponyint_heap_mark(chunk, p))
      recurse(ctx, p, t->trace);
  } else {
    // Do a shallow mark. If the same address is later marked as something that
    // is not opaque, it will recurse.
    ponyint_heap_mark_shallow(chunk, p);
  }
}