Skip to content
Snippets Groups Projects
Select Git revision
  • 45637c689342fbdb8ee30cb1f6dbe5e587f2f303
  • 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.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
  • v8.0.1982
41 results

object.h

Blame
    • Fredrik Hübinette (Hubbe)'s avatar
      45637c68
      added mutex code to each memory object (for --with-unlocked) · 45637c68
      Fredrik Hübinette (Hubbe) authored
      Rev: src/array.c:1.103
      Rev: src/array.h:1.33
      Rev: src/constants.c:1.29
      Rev: src/constants.h:1.17
      Rev: src/mapping.h:1.36
      Rev: src/multiset.c:1.33
      Rev: src/multiset.h:1.18
      Rev: src/object.c:1.167
      Rev: src/object.h:1.61
      Rev: src/pike_cpulib.c:1.2
      Rev: src/pike_cpulib.h:1.9
      Rev: src/pike_threadlib.h:1.1
      Rev: src/program.c:1.309
      Rev: src/program.h:1.123
      Rev: src/svalue.h:1.87
      Rev: src/threads.h:1.113
      45637c68
      History
      added mutex code to each memory object (for --with-unlocked)
      Fredrik Hübinette (Hubbe) authored
      Rev: src/array.c:1.103
      Rev: src/array.h:1.33
      Rev: src/constants.c:1.29
      Rev: src/constants.h:1.17
      Rev: src/mapping.h:1.36
      Rev: src/multiset.c:1.33
      Rev: src/multiset.h:1.18
      Rev: src/object.c:1.167
      Rev: src/object.h:1.61
      Rev: src/pike_cpulib.c:1.2
      Rev: src/pike_cpulib.h:1.9
      Rev: src/pike_threadlib.h:1.1
      Rev: src/program.c:1.309
      Rev: src/program.h:1.123
      Rev: src/svalue.h:1.87
      Rev: src/threads.h:1.113
    multiset.c 157.20 KiB
    /*
    || 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: multiset.c,v 1.115 2008/07/22 20:03:19 mast Exp $
    */
    
    #include "global.h"
    
    /* Multisets using rbtree.
     *
     * Created by Martin Stjernholm 2001-05-07
     */
    
    #include "builtin_functions.h"
    #include "gc.h"
    #include "interpret.h"
    #include "multiset.h"
    #include "mapping.h"
    #include "object.h"
    #include "opcodes.h"
    #include "pike_error.h"
    #include "rbtree_low.h"
    #include "pike_security.h"
    #include "svalue.h"
    
    #ifdef TEST_MULTISET
    #include "builtin_functions.h"
    #include "constants.h"
    #include "mapping.h"
    #endif
    
    #include "block_alloc.h"
    
    /* FIXME: Optimize finds and searches on type fields? (But not when
     * objects are involved!) Well.. Although cheap I suspect it pays off
     * so extremely seldom that it isn't worth it. /mast */
    
    #include <assert.h>
    
    #define sp Pike_sp
    
    /* The following defines the allocation policy. It's almost the same
     * as for mappings. */
    #define ALLOC_SIZE(size) ((size) ? (size) + 4 : 0)
    #define ENLARGE_SIZE(size) (((size) << 1) + 4)
    #define DO_SHRINK(msd, extra) ((((msd)->size + extra) << 2) + 4 <= (msd)->allocsize)
    
    #if defined (PIKE_DEBUG) || defined (TEST_MULTISET)
    static void debug_dump_ind_data (struct msnode_ind *node,
    				 struct multiset_data *msd);
    static void debug_dump_indval_data (struct msnode_indval *node,
    				    struct multiset_data *msd);
    DECLSPEC(noreturn) static void debug_multiset_fatal (
      struct multiset *l, const char *fmt, ...) ATTRIBUTE((noreturn, format (printf, 2, 3)));
    #define multiset_fatal (fprintf (stderr, "%s:%d: Fatal in multiset: ", \
    				 __FILE__, __LINE__), debug_multiset_fatal)
    #endif
    
    #ifdef PIKE_DEBUG
    
    /* To get good type checking. */
    static INLINE union msnode **msnode_ptr_check (union msnode **x)
      {return x;}
    static INLINE struct msnode_ind *msnode_ind_check (struct msnode_ind *x)
      {return x;}
    static INLINE struct msnode_indval *msnode_indval_check (struct msnode_indval *x)
      {return x;}
    
    #define sub_extra_ref(X) do {						\