pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:996: Inside #if defined(GC_STACK_DEBUG)
   fprintf (stderr, "data=%p prev=%p checkfn=%p weak=%d",    f->data, f->prev, f->checkfn, f->weak);   }   #endif      static void describe_marker(struct marker *m)   {    if (m) {    fprintf(stderr, "marker at %p: flags=0x%05lx refs=%d weak=%d "    "xrefs=%d saved=%d frame=%p", -  m, (long) m->flags, m->refs, m->weak_refs, +  m, (long) m->flags, m->gc_refs, m->weak_refs,    m->xrefs, m->saved_refs, m->frame);    if (m->frame) {    fputs(" [", stderr);    describe_rec_frame (m->frame);    putc(']', stderr);    }    putc('\n', stderr);    }    else    fprintf(stderr, "no marker\n");
pike.git/src/gc.c:1926: Inside #if defined(PIKE_DEBUG)
   if (Pike_in_gc != GC_PASS_CHECK)    Pike_fatal("gc check attempted in invalid pass.\n");       m = get_marker(a);       if (!*(INT32 *)a)    gc_fatal(a, 1, "GC check on thing without refs.\n");    if (m->saved_refs == -1) m->saved_refs = *(INT32 *)a;    else if (m->saved_refs != *(INT32 *)a)    gc_fatal(a, 1, "Refs changed in gc check pass.\n"); -  if (m->refs + m->xrefs >= *(INT32 *) a) -  /* m->refs will be incremented by the caller. */ +  if (m->gc_refs + m->xrefs >= *(INT32 *) a) +  /* m->gc_refs will be incremented by the caller. */    gc_fatal (a, 1, "Thing is getting more internal refs (%d + %d) "    "than refs (%d).\n"    "(Could be an extra free somewhere, or "    "a pointer might have been checked more than once.)\n", -  m->refs, m->xrefs, *(INT32 *) a); +  m->gc_refs, m->xrefs, *(INT32 *) a);    checked++;       return m;   }      #endif /* PIKE_DEBUG */      PMOD_EXPORT INT32 real_gc_check(void *a)   {    struct marker *m;
pike.git/src/gc.c:1957: Inside #if defined(PIKE_DEBUG)
   gc_fatal (a, 0, "gc_check() called outside GC_ENTER.\n");    if (gc_is_watching && (m = find_marker(a)) && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */    gc_watched_found (m, "gc_check()");    }    if (!(m = gc_check_debug(a, 0))) return 0;   #else    m = get_marker(a);   #endif    -  ret=m->refs; -  add_ref(m); -  if (m->refs == *(INT32 *) a) +  ret=m->gc_refs++; +  if (m->gc_refs == *(INT32 *) a)    m->flags |= GC_NOT_REFERENCED;    return ret;   }      PMOD_EXPORT INT32 real_gc_check_weak(void *a)   {    struct marker *m;    INT32 ret;      #ifdef PIKE_DEBUG
pike.git/src/gc.c:1981: Inside #if defined(PIKE_DEBUG)
   gc_fatal (a, 0, "gc_check_weak() called outside GC_ENTER.\n");    if (gc_is_watching && (m = find_marker(a)) && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */    gc_watched_found (m, "gc_check_weak()");    }    if (!(m = gc_check_debug(a, 1))) return 0;    if (m->weak_refs < 0)    gc_fatal(a, 1, "Thing has already reached threshold for weak free.\n");    if (m->weak_refs >= *(INT32 *) a)    gc_fatal(a, 1, "Thing has gotten more weak refs than refs.\n"); -  if (m->weak_refs > m->refs + 1) +  if (m->weak_refs > m->gc_refs + 1)    gc_fatal(a, 1, "Thing has gotten more weak refs than internal refs.\n");   #else    m = get_marker(a);   #endif       m->weak_refs++;    gc_ext_weak_refs++;    if (m->weak_refs == *(INT32 *) a)    m->weak_refs = -1;    -  ret=m->refs; -  add_ref(m); -  if (m->refs == *(INT32 *) a) +  ret=m->gc_refs++; +  if (m->gc_refs == *(INT32 *) a)    m->flags |= GC_NOT_REFERENCED;    return ret;   }      static void cleanup_markers (void)   {   }      void exit_gc(void)   {
pike.git/src/gc.c:2208: Inside #if defined(PIKE_DEBUG) and #if defined(DEBUG_MALLOC)
   a, place ? place : "");    if (gc_found_in) describe (gc_found_in);    return 0;    }   #endif       m=get_marker(a);    m->xrefs++;    m->flags|=GC_XREFERENCED;    if(Pike_in_gc == GC_PASS_CHECK && -  (m->refs + m->xrefs > *(INT32 *)a || +  (m->gc_refs + m->xrefs > *(INT32 *)a ||    (m->saved_refs != -1 && m->saved_refs != *(INT32 *)a)))    gc_fatal(a, 1, "Ref counts are wrong.\n");    return 0;   }      #define LOW_CHECK_REC_FRAME(f, file, line) do { \    if (f->rf_flags & GC_FRAME_FREED) \    dloc_gc_fatal (file, line, f->data, 0, \    "Accessing freed gc_stack_frame %p.\n", f); \    if (f->cycle_id->rf_flags & GC_FRAME_FREED) { \
pike.git/src/gc.c:2394: Inside #if defined(PIKE_DEBUG)
   if (!a) Pike_fatal("Got null pointer.\n");    if (Pike_in_gc != GC_PASS_MARK && Pike_in_gc != GC_PASS_ZAP_WEAK)    Pike_fatal("gc_do_weak_free() called in invalid gc pass.\n");    if (gc_debug) {    if (!(m = find_marker(a)))    gc_fatal(a, 0, "gc_do_weak_free() got unknown object.\n");    }    else m = get_marker(a);    debug_malloc_touch(a);    -  if (m->weak_refs > m->refs) +  if (m->weak_refs > m->gc_refs)    gc_fatal(a, 0, "More weak references than internal references.\n");   #else    m = get_marker(a);   #endif       if (Pike_in_gc != GC_PASS_ZAP_WEAK) {    if (m->weak_refs < 0)    goto should_free;    }    else
pike.git/src/gc.c:2495:    struct marker *m;      #ifdef PIKE_DEBUG    if (Pike_in_gc == GC_PASS_ZAP_WEAK && !find_marker (a))    gc_fatal_2 (a, type, 0, "gc_mark() called for for thing without marker "    "in zap weak pass.\n");   #endif       m = get_marker (a);    -  /* Note: m->refs and m->xrefs are useless already here due to how +  /* Note: m->gc_refs and m->xrefs are useless already here due to how    * gc_free_(short_)svalue works. */      #ifdef PIKE_DEBUG    if (gc_is_watching && m && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */    gc_watched_found (m, "gc_mark()");    }    if (!a) Pike_fatal("Got null pointer.\n");    if (Pike_in_gc != GC_PASS_MARK && Pike_in_gc != GC_PASS_ZAP_WEAK)    Pike_fatal("GC mark attempted in invalid pass.\n");