Home | History | Annotate | Download | only in src

Lines Matching full:malloc

2   This is a version (aka dlmalloc) of malloc/free/realloc written by
9 Note: There may be an updated version of this malloc obtainable at
10 ftp://gee.cs.oswego.edu/pub/misc/malloc.c
21 For convenience, an include file for code using this malloc is at:
22 ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
25 excerpts from this file needed for using this malloc on ANSI C/C++
28 own malloc.h that does include all settings by cutting at the point
30 library containing a malloc that is based on some version of this
31 malloc (for example in linux). You might still want to use the one
41 than pointers, you can use a previous release of this malloc
58 Even a request for zero bytes (i.e., malloc(0)) returns a
61 allocated than were requested in malloc) is less than or equal
68 The "security" of malloc refers to the ability of malicious
70 space that is not currently malloc'ed or overwriting past the
71 ends of chunks) in code that calls malloc. This malloc
76 for malloc itself is not corrupted by some other means. This
83 execution of a program using malloc, but differ across
94 has no effect, and a malloc that encounters a bad address
103 else. And if if you are sure that your program using malloc has
108 When USE_LOCKS is defined, each public call to malloc, free,
113 basis for extensions. If you are using malloc in a concurrent
115 a version of this malloc. (See http://www.malloc.de).
118 This malloc can use unix sbrk or any emulation (invoked using
133 most tunable malloc ever written. However it is among the fastest
136 general-purpose allocator for malloc-intensive programs.
138 In most ways, this malloc is a best-fit allocator. Generally, it
169 http://gee.cs.oswego.edu/dl/html/malloc.html
172 If MSPACES is defined, then in addition to malloc, free, etc.,
174 are versions of malloc routines that take an "mspace" argument
178 and your system malloc for others, you can compile with
184 use "USE_DL_PREFIX" to relabel the global malloc.)
213 Controls the minimum alignment for malloc'ed chunks. It must be a
241 This can be useful when you only want to use this malloc in one part
242 of a program, using your regular system malloc elsewhere.
247 message, because the underlying print routines in turn call malloc,
251 addresses etc) rather than malloc-triggered checks, so will also
260 ability to ever return it from malloc again, but enabling the
279 version of the assert macro causes malloc to be called, which will
285 The action to take before "return 0" when malloc fails to be able to
308 set it true anyway, since malloc copes with non-contiguities.
337 Causes malloc to use the builtin ffs() function to compute indices.
345 The system page size. To the extent possible, this malloc manages
352 Causes malloc to use /dev/random to initialize secure magic seed for
368 since this malloc returns a unique pointer for malloc(0), so does
389 versions of malloc, the equivalent of this option was called
577 numbers for mallopt, normally defined in malloc.h. None of these
578 are used in this malloc, so setting them has no effect. But this
579 malloc does support the following options.
590 This version of malloc supports the standard SVID/XPG mallinfo
593 /usr/include/malloc.h defining struct mallinfo. The main
596 are not even meaningful in this version of malloc. These fields are
601 /usr/include/malloc.h file that includes a declaration of struct
614 #include "/usr/include/malloc.h"
644 #define dlmalloc malloc
662 malloc(size_t n)
667 If n is zero, malloc returns a minimum-sized chunk. (The minimum
680 allocated using malloc or a related routine such as realloc.
701 employs the equivalent of a malloc-copy-free sequence.
703 If p is null, realloc is equivalent to malloc.
725 8-byte alignment is guaranteed by normal malloc calls, so don't
746 normally defined in malloc.h. None of these are use in this malloc,
747 so setting them has no effect. But this malloc also supports other
762 number of bytes allocated by malloc, realloc etc., is less than this
775 by malloc, realloc etc., is less than this value. Unlike mallinfo,
887 should instead use a single regular malloc, and assign pointers at
916 detect enough difference from series of malloc calls to bother.
936 to sbrk) if there is unused memory at the `high' end of the malloc
966 p = malloc(n);
976 number of bytes allocated via malloc (or realloc, etc) but not yet
985 (normally sbrk) outside of malloc.
1035 mspace_malloc behaves as malloc, but operates within
1133 To make a fully customizable malloc.h header file, cut everything
1134 above this line, put into file malloc.h, edit to suit, and #include it
1135 on the next line, as well as in programs that use this malloc.
1139 /* #include "malloc.h" */
1626 /* The smallest size we can malloc is an aligned minimal chunk */
1630 /* conversion from malloc headers to user pointers, and back */
1824 Each malloc space may include non-contiguous segments, held in a
1975 intended to reduce the branchiness of paths through malloc etc, as
2342 For security, the main invariant is that malloc/free/etc never
2345 malloc (because of these checks). In essence this means that we
2353 that the mstate controlling malloc/free is intact. This is a
2360 computed by any code successfully malloc'ing any chunk, so does not
2489 /* Set up lock for main malloc area */
3123 /* Relays to internal calls to malloc/free from realloc, memalign etc */
3152 /* Malloc using mmap */
3656 /* ---------------------------- malloc support --------------------------- */
3709 /* If dv is a better fit, return 0 so malloc will use it */
3784 /* Try to either shrink or extend into top. Else malloc-copy-free */
3844 if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */
3987 malloc won't use it, since we would not be able to later
4835 but this will usually result in a malloc failure.)
4843 addresses, it must be OK for malloc'ed chunks to span multiple
4966 * Bypass most of malloc if no frees. Thanks To Emery Berger.
4988 * Collect all cases in malloc requiring system memory into sysmalloc
5021 * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
5070 * malloc
5079 * merged all consolidations to one part of malloc proper
5082 * Propagate failure in realloc if malloc returns 0
5096 * Based loosely on libg++-1.2X malloc. (It retains some of the overall