Skip to content
Snippets Groups Projects
Select Git revision
  • c43e8cadd02224b249156fd2ff3e44e8f71c7b88
  • master default protected
  • 9.0
  • 8.0
  • 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
  • nt-tools
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • 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
  • v8.0.1980
  • v8.0.1978
  • v8.0.1976
  • v8.0.1974
  • v8.0.1972
  • v8.0.1970
  • v8.0.1968
  • v8.0.1966
41 results

malloc.c

Blame
  • malloc.c 175.82 KiB
    /* Begin pike preamble */
    /* This is only used when --enable-dlmalloc is specified (default on
     * Windows). */
    #include "global.h"
    #define USE_LOCKS 1
    #define USE_DL_PREFIX 1
    /* Further pike changes below: PMOD_EXPORTs and lines marked "PIKE". */
    /* End pike preamble */
    
    /*
      This is a version (aka dlmalloc) of malloc/free/realloc written by
      Doug Lea and released to the public domain, as explained at
      http://creativecommons.org/licenses/publicdomain.  Send questions,
      comments, complaints, performance data, etc to dl@cs.oswego.edu
    
    * Version 2.8.3 Thu Sep 22 11:16:15 2005  Doug Lea  (dl at gee)
    
       Note: There may be an updated version of this malloc obtainable at
               ftp://gee.cs.oswego.edu/pub/misc/malloc.c
             Check before installing!
    
    * Quickstart
    
      This library is all in one file to simplify the most common usage:
      ftp it, compile it (-O3), and link it into another program. All of
      the compile-time options default to reasonable values for use on
      most platforms.  You might later want to step through various
      compile-time and dynamic tuning options.
    
      For convenience, an include file for code using this malloc is at:
         ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
      You don't really need this .h file unless you call functions not
      defined in your system include files.  The .h file contains only the
      excerpts from this file needed for using this malloc on ANSI C/C++
      systems, so long as you haven't changed compile-time options about
      naming and tuning parameters.  If you do, then you can create your
      own malloc.h that does include all settings by cutting at the point
      indicated below. Note that you may already by default be using a C
      library containing a malloc that is based on some version of this
      malloc (for example in linux). You might still want to use the one
      in this file to customize settings or to avoid overheads associated
      with library versions.
    
    * Vital statistics:
    
      Supported pointer/size_t representation:       4 or 8 bytes
           size_t MUST be an unsigned type of the same width as
           pointers. (If you are using an ancient system that declares
           size_t as a signed type, or need it to be a different width
           than pointers, you can use a previous release of this malloc
           (e.g. 2.7.2) supporting these.)
    
      Alignment:                                     8 bytes (default)
           This suffices for nearly all current machines and C compilers.
           However, you can define MALLOC_ALIGNMENT to be wider than this
           if necessary (up to 128bytes), at the expense of using more space.
    
      Minimum overhead per allocated chunk:   4 or  8 bytes (if 4byte sizes)
                                              8 or 16 bytes (if 8byte sizes)
           Each malloced chunk has a hidden word of overhead holding size
           and status information, and additional cross-check word
           if FOOTERS is defined.
    
      Minimum allocated size: 4-byte ptrs:  16 bytes    (including overhead)
                              8-byte ptrs:  32 bytes    (including overhead)
    
           Even a request for zero bytes (i.e., malloc(0)) returns a
           pointer to something of the minimum allocatable size.
           The maximum overhead wastage (i.e., number of extra bytes
           allocated than were requested in malloc) is less than or equal