Lines Matching full:malloc
38 This is a version (aka dlmalloc) of malloc/free/realloc written by
45 Note: There may be an updated version of this malloc obtainable at
46 ftp://gee.cs.oswego.edu/pub/misc/malloc.c
57 For convenience, an include file for code using this malloc is at:
58 ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
61 excerpts from this file needed for using this malloc on ANSI C/C++
64 own malloc.h that does include all settings by cutting at the point
66 library containing a malloc that is based on some version of this
67 malloc (for example in linux). You might still want to use the one
77 than pointers, you can use a previous release of this malloc
94 Even a request for zero bytes (i.e., malloc(0)) returns a
97 allocated than were requested in malloc) is less than or equal
104 The "security" of malloc refers to the ability of malicious
106 space that is not currently malloc'ed or overwriting past the
107 ends of chunks) in code that calls malloc. This malloc
112 for malloc itself is not corrupted by some other means. This
119 execution of a program using malloc, but differ across
130 has no effect, and a malloc that encounters a bad address
139 else. And if if you are sure that your program using malloc has
144 When USE_LOCKS is defined, each public call to malloc, free,
149 basis for extensions. If you are using malloc in a concurrent
151 a version of this malloc. (See http://www.malloc.de).
154 This malloc can use unix sbrk or any emulation (invoked using
169 most tunable malloc ever written. However it is among the fastest
172 general-purpose allocator for malloc-intensive programs.
174 In most ways, this malloc is a best-fit allocator. Generally, it
205 http://gee.cs.oswego.edu/dl/html/malloc.html
208 If MSPACES is defined, then in addition to malloc, free, etc.,
210 are versions of malloc routines that take an "mspace" argument
214 and your system malloc for others, you can compile with
220 use "USE_DL_PREFIX" to relabel the global malloc.)
249 Controls the minimum alignment for malloc'ed chunks. It must be a
277 This can be useful when you only want to use this malloc in one part
278 of a program, using your regular system malloc elsewhere.
283 message, because the underlying print routines in turn call malloc,
287 addresses etc) rather than malloc-triggered checks, so will also
296 ability to ever return it from malloc again, but enabling the
315 version of the assert macro causes malloc to be called, which will
321 The action to take before "return 0" when malloc fails to be able to
344 set it true anyway, since malloc copes with non-contiguities.
373 Causes malloc to use the builtin ffs() function to compute indices.
381 The system page size. To the extent possible, this malloc manages
388 Causes malloc to use /dev/random to initialize secure magic seed for
404 since this malloc returns a unique pointer for malloc(0), so does
425 versions of malloc, the equivalent of this option was called
614 #define malloc SDL_malloc
621 numbers for mallopt, normally defined in malloc.h. None of these
622 are used in this malloc, so setting them has no effect. But this
623 malloc does support the following options.
634 This version of malloc supports the standard SVID/XPG mallinfo
637 /usr/include/malloc.h defining struct mallinfo. The main
640 are not even meaningful in this version of malloc. These fields are
645 /usr/include/malloc.h file that includes a declaration of struct
658 #include "/usr/include/malloc.h"
688 #define dlmalloc malloc
706 malloc(size_t n)
711 If n is zero, malloc returns a minimum-sized chunk. (The minimum
724 allocated using malloc or a related routine such as realloc.
745 employs the equivalent of a malloc-copy-free sequence.
747 If p is null, realloc is equivalent to malloc.
769 8-byte alignment is guaranteed by normal malloc calls, so don't
790 normally defined in malloc.h. None of these are use in this malloc,
791 so setting them has no effect. But this malloc also supports other
806 number of bytes allocated by malloc, realloc etc., is less than this
819 by malloc, realloc etc., is less than this value. Unlike mallinfo,
931 should instead use a single regular malloc, and assign pointers at
960 detect enough difference from series of malloc calls to bother.
980 to sbrk) if there is unused memory at the `high' end of the malloc
1010 p = malloc(n);
1020 number of bytes allocated via malloc (or realloc, etc) but not yet
1029 (normally sbrk) outside of malloc.
1079 mspace_malloc behaves as malloc, but operates within
1177 To make a fully customizable malloc.h header file, cut everything
1178 above this line, put into file malloc.h, edit to suit, and #include it
1179 on the next line, as well as in programs that use this malloc.
1183 /* #include "malloc.h" */
1672 /* The smallest size we can malloc is an aligned minimal chunk */
1676 /* conversion from malloc headers to user pointers, and back */
1870 Each malloc space may include non-contiguous segments, held in a
1985 intended to reduce the branchiness of paths through malloc etc, as
2352 For security, the main invariant is that malloc/free/etc never
2355 malloc (because of these checks). In essence this means that we
2363 that the mstate controlling malloc/free is intact. This is a
2370 computed by any code successfully malloc'ing any chunk, so does not
2499 /* Set up lock for main malloc area */
3135 /* Relays to internal calls to malloc/free from realloc, memalign etc */
3164 /* Malloc using mmap */
3666 /* ---------------------------- malloc support --------------------------- */
3719 /* If dv is a better fit, return 0 so malloc will use it */
3794 /* Try to either shrink or extend into top. Else malloc-copy-free */
3854 if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */
3997 malloc won't use it, since we would not be able to later
4845 but this will usually result in a malloc failure.)
4853 addresses, it must be OK for malloc'ed chunks to span multiple
4976 * Bypass most of malloc if no frees. Thanks To Emery Berger.
4998 * Collect all cases in malloc requiring system memory into sysmalloc
5031 * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
5080 * malloc: swap order of clean-bin strategy;
5089 * merged all consolidations to one part of malloc proper
5092 * Propagate failure in realloc if malloc returns 0
5106 * Based loosely on libg++-1.2X malloc. (It retains some of the overall