pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:1882:      void debug_gc_touch(void *a)   {    struct marker *m;      #ifdef PIKE_DEBUG    if (gc_is_watching && (m = find_marker(a)) && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */    gc_watched_found (m, "gc_touch()");    } +  if (!a) Pike_fatal("Got null pointer.\n");   #endif    -  if (!a) Pike_fatal("Got null pointer.\n"); -  +     switch (Pike_in_gc) {    case GC_PASS_PRETOUCH:    m = find_marker(a); -  + #ifdef PIKE_DEBUG    if (   #ifdef DO_PIKE_CLEANUP    !gc_keep_markers &&   #endif -  m && !(m->flags & (GC_PRETOUCHED - #ifdef PIKE_DEBUG -  |GC_WATCHED - #endif -  ))) +  m && !(m->flags & (GC_PRETOUCHED|GC_WATCHED )))    gc_fatal(a, 1, "Thing got an existing but untouched marker.\n"); -  + #endif /* PIKE_DEBUG */    m = get_marker(a);    m->flags |= GC_PRETOUCHED;   #ifdef PIKE_DEBUG    m->saved_refs = *(INT32 *) a;   #endif    break;       case GC_PASS_POSTTOUCH: {   #ifdef PIKE_DEBUG    int extra_ref;   #endif    m = find_marker(a); -  + #ifdef PIKE_DEBUG    if (!m)    gc_fatal(a, 1, "Found a thing without marker.\n");    else if (!(m->flags & GC_PRETOUCHED))    gc_fatal(a, 1, "Thing got an existing but untouched marker.\n");    if (gc_destruct_everything && (m->flags & GC_MARKED))    gc_fatal (a, 1, "Thing got marked in gc_destruct_everything mode.\n"); - #ifdef PIKE_DEBUG +     extra_ref = (m->flags & GC_GOT_EXTRA_REF) == GC_GOT_EXTRA_REF;    if (m->saved_refs + extra_ref < *(INT32 *) a)    if (m->flags & GC_WEAK_FREED)    gc_fatal(a, 1, "Something failed to remove weak reference(s) to thing, "    "or it has gotten more references since gc start.\n");    else    gc_fatal(a, 1, "Thing has gotten more references since gc start.\n");    else    if (m->weak_refs > m->saved_refs)    gc_fatal(a, 0, "A thing got more weak references than references.\n");