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.281 2007/05/13 14:55:26 mast Exp $ + || $Id: gc.c,v 1.282 2007/05/13 15:42:06 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:2306: Inside #if defined(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);   #endif       move_marker (m, debug_malloc_pass (new));   }    + int gc_object_is_live (struct object *o) + { +  extern void compat_event_handler(int e); +  struct program *p = o->prog; +  if (!p) return 0; +  if (FIND_LFUN (p, LFUN_DESTROY) != -1) return 1; +  if (!p->event_handler) return 0; +  if (p->event_handler != compat_event_handler) +  /* Unknown handler - have to assume it might act on PROG_EVENT_EXIT. */ +  return 1; +  return !!((void (**) (struct object *)) p->program)[PROG_EVENT_EXIT]; + } +    PMOD_EXPORT void gc_cycle_enqueue(gc_cycle_check_cb *checkfn, void *data, int weak)   {    struct 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()");    }