Skip to content
Snippets Groups Projects
Select Git revision
  • 8f797ab27fd39e7aaee2cc0790d96e8d5ae2037e
  • master default protected
  • 9.0
  • 8.0
  • nt-tools
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2020
  • v8.0.2018
  • v8.0.2016
  • v8.0.2014
  • v8.0.2012
  • v8.0.2008
  • v8.0.2006
  • v8.0.2004
  • v8.0.2002
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
41 results

export_list

Blame
  • gc.c 60.37 KiB
    /*\
    ||| This file a part of Pike, and is copyright by Fredrik Hubinette
    ||| Pike is distributed as GPL (General Public License)
    ||| See the files COPYING and DISCLAIMER for more information.
    \*/
    /**/
    #include "global.h"
    
    struct callback *gc_evaluator_callback=0;
    
    #include "array.h"
    #include "multiset.h"
    #include "mapping.h"
    #include "object.h"
    #include "program.h"
    #include "stralloc.h"
    #include "stuff.h"
    #include "error.h"
    #include "pike_memory.h"
    #include "pike_macros.h"
    #include "pike_types.h"
    #include "time_stuff.h"
    #include "constants.h"
    #include "interpret.h"
    #include "bignum.h"
    
    #include "gc.h"
    #include "main.h"
    #include <math.h>
    
    #include "block_alloc.h"
    
    RCSID("$Id: gc.c,v 1.127 2000/08/27 15:21:50 mast Exp $");
    
    /* Run garbage collect approximately every time
     * 20 percent of all arrays, objects and programs is
     * garbage.
     */
    
    #define GC_CONST 20
    #define MIN_ALLOC_THRESHOLD 1000
    #define MAX_ALLOC_THRESHOLD 10000000
    #define MULTIPLIER 0.9
    #define MARKER_CHUNK_SIZE 1023
    #define GC_LINK_CHUNK_SIZE 31
    
    /* The gc will free all things with no external references that isn't
     * referenced by undestructed objects with destroy() lfuns (known as
     * "live" objects). Live objects without external references are then
     * destructed and garbage collected with normal refcount garbing
     * (which might leave dead garbage around for the next gc). These live
     * objects are destructed in an order that tries to be as well defined
     * as possible using several rules:
     *
     * o  If an object A references B single way, then A is destructed
     *    before B.
     * o  If A and B are in a cycle, and there is a reference somewhere
     *    from B to A that is weaker than any reference from A to B, then
     *    A is destructed before B.
     * o  Weak references are considered weaker than normal ones, and both
     *    are considered weaker than strong references.
     * o  Strong references are used in special cases like parent object
     *    references. There can never be a cycle consisting only of strong
     *    references. (This means the gc will never destruct a parent
     *    object before all childs has been destructed.)
     *
     * The gc tries to detect and warn about cases where there are live
     * objects with no well defined order between them. There are cases
     * that are missed by this detection, though.
     *