pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: gc.c,v 1.271 2006/01/23 14:00:16 mast Exp $ + || $Id: gc.c,v 1.272 2006/02/18 05:08:24 mast Exp $   */      #include "global.h"      struct callback *gc_evaluator_callback=0;      #include "array.h"   #include "multiset.h"   #include "mapping.h"   #include "object.h"
pike.git/src/gc.c:2059:    if (m->weak_refs) {    gc_ext_weak_refs -= m->weak_refs;    m->weak_refs = 0;    }    m->flags = (m->flags & ~GC_NOT_REFERENCED) | GC_MARKED;    DO_IF_DEBUG(marked++);    return 1;    }   }    + void gc_move_marker (void *old, void *new) + { +  struct marker *m = get_marker (debug_malloc_pass (old)); +  + #ifdef PIKE_DEBUG +  if (!old) Pike_fatal("Got null pointer in old.\n"); +  if (!new) Pike_fatal("Got null pointer in new.\n"); +  if (!m) Pike_fatal ("Have no marker for old block %p.\n", old); +  if (find_marker (new)) +  Pike_fatal ("New block %p already got a marker.\n", new); +  if (!Pike_in_gc || Pike_in_gc >= GC_PASS_FREE) +  Pike_fatal ("gc move mark attempted in invalid pass.\n"); + #endif +  +  move_marker (m, new); + } +    PMOD_EXPORT void gc_cycle_enqueue(gc_cycle_check_cb *checkfn, void *data, int weak)   {    struct gc_link_frame *l = alloc_link_frame();   #ifdef PIKE_DEBUG    {    struct marker *m;    if (gc_is_watching && (m = find_marker(data)) && m->flags & GC_WATCHED) {    /* This is useful to set breakpoints on. */    gc_watched_found (m, "gc_cycle_enqueue()");    }