Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
malloc.h
Go to the documentation of this file.
1/*
2 * Default header file for malloc-2.8.x, written by Doug Lea
3 * and released to the public domain, as explained at
4 * http://creativecommons.org/publicdomain/zero/1.0/
5 *
6 * This header is for ANSI C/C++ only. You can set any of
7 * the following #defines before including:
8 *
9 * If USE_DL_PREFIX is defined, it is assumed that malloc.c
10 * was also compiled with this option, so all routines
11 * have names starting with "dl".
12 *
13 * If HAVE_USR_INCLUDE_MALLOC_H is defined, it is assumed that this
14 * file will be #included AFTER <malloc.h>. This is needed only if
15 * your system defines a struct mallinfo that is incompatible with the
16 * standard one declared here. Otherwise, you can include this file
17 * INSTEAD of your system system <malloc.h>. At least on ANSI, all
18 * declarations should be compatible with system versions
19 *
20 * If MSPACES is defined, declarations for mspace versions are included.
21 */
22
23#ifndef MALLOC_280_H
24#define MALLOC_280_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <stddef.h> /* for size_t */
31
32#ifndef ONLY_MSPACES
33#define ONLY_MSPACES 0 /* define to a value */
34#elif ONLY_MSPACES != 0
35#define ONLY_MSPACES 1
36#endif /* ONLY_MSPACES */
37#ifndef NO_MALLINFO
38#define NO_MALLINFO 0
39#endif /* NO_MALLINFO */
40
41#ifndef MSPACES
42#if ONLY_MSPACES
43#define MSPACES 1
44#else /* ONLY_MSPACES */
45#define MSPACES 0
46#endif /* ONLY_MSPACES */
47#endif /* MSPACES */
48
49#if !ONLY_MSPACES
50
51#ifndef USE_DL_PREFIX
52#define dlcalloc calloc
53#define dlfree free
54#define dlmalloc malloc
55#define dlmemalign memalign
56#define dlposix_memalign posix_memalign
57#define dlrealloc realloc
58#define dlvalloc valloc
59#define dlpvalloc pvalloc
60#define dlmallinfo mallinfo
61#define dlmallopt mallopt
62#define dlmalloc_trim malloc_trim
63#define dlmalloc_stats malloc_stats
64#define dlmalloc_usable_size malloc_usable_size
65#define dlmalloc_footprint malloc_footprint
66#define dlmalloc_max_footprint malloc_max_footprint
67#define dlmalloc_footprint_limit malloc_footprint_limit
68#define dlmalloc_set_footprint_limit malloc_set_footprint_limit
69#define dlmalloc_inspect_all malloc_inspect_all
70#define dlindependent_calloc independent_calloc
71#define dlindependent_comalloc independent_comalloc
72#define dlbulk_free bulk_free
73#endif /* USE_DL_PREFIX */
74
75#if !NO_MALLINFO
76#ifndef HAVE_USR_INCLUDE_MALLOC_H
77#ifndef _MALLOC_H
78#ifndef MALLINFO_FIELD_TYPE
79#define MALLINFO_FIELD_TYPE size_t
80#endif /* MALLINFO_FIELD_TYPE */
81#ifndef STRUCT_MALLINFO_DECLARED
82#define STRUCT_MALLINFO_DECLARED 1
83struct mallinfo
84{
85 MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
86 MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
87 MALLINFO_FIELD_TYPE smblks; /* always 0 */
88 MALLINFO_FIELD_TYPE hblks; /* always 0 */
89 MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
90 MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */
91 MALLINFO_FIELD_TYPE fsmblks; /* always 0 */
92 MALLINFO_FIELD_TYPE uordblks; /* total allocated space */
93 MALLINFO_FIELD_TYPE fordblks; /* total free space */
94 MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */
95};
96#endif /* STRUCT_MALLINFO_DECLARED */
97#endif /* _MALLOC_H */
98#endif /* HAVE_USR_INCLUDE_MALLOC_H */
99#endif /* !NO_MALLINFO */
100
101/*
102 * malloc(size_t n)
103 * Returns a pointer to a newly allocated chunk of at least n bytes, or
104 * null if no space is available, in which case errno is set to ENOMEM
105 * on ANSI C systems.
106 *
107 * If n is zero, malloc returns a minimum-sized chunk. (The minimum
108 * size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
109 * systems.) Note that size_t is an unsigned type, so calls with
110 * arguments that would be negative if signed are interpreted as
111 * requests for huge amounts of space, which will often fail. The
112 * maximum supported value of n differs across systems, but is in all
113 * cases less than the maximum representable value of a size_t.
114 */
115void* dlmalloc(size_t);
116
117/*
118 * free(void* p)
119 * Releases the chunk of memory pointed to by p, that had been previously
120 * allocated using malloc or a related routine such as realloc.
121 * It has no effect if p is null. If p was not malloced or already
122 * freed, free(p) will by default cuase the current program to abort.
123 */
124void dlfree(void *);
125
126/*
127 * calloc(size_t n_elements, size_t element_size);
128 * Returns a pointer to n_elements * element_size bytes, with all locations
129 * set to zero.
130 */
131void* dlcalloc(size_t, size_t);
132
133/*
134 * realloc(void* p, size_t n)
135 * Returns a pointer to a chunk of size n that contains the same data
136 * as does chunk p up to the minimum of (n, p's size) bytes, or null
137 * if no space is available.
138 *
139 * The returned pointer may or may not be the same as p. The algorithm
140 * prefers extending p in most cases when possible, otherwise it
141 * employs the equivalent of a malloc-copy-free sequence.
142 *
143 * If p is null, realloc is equivalent to malloc.
144 *
145 * If space is not available, realloc returns null, errno is set (if on
146 * ANSI) and p is NOT freed.
147 *
148 * if n is for fewer bytes than already held by p, the newly unused
149 * space is lopped off and freed if possible. realloc with a size
150 * argument of zero (re)allocates a minimum-sized chunk.
151 *
152 * The old unix realloc convention of allowing the last-free'd chunk
153 * to be used as an argument to realloc is not supported.
154 */
155void* dlrealloc(void *, size_t);
156
157/*
158 * realloc_in_place(void* p, size_t n)
159 * Resizes the space allocated for p to size n, only if this can be
160 * done without moving p (i.e., only if there is adjacent space
161 * available if n is greater than p's current allocated size, or n is
162 * less than or equal to p's size). This may be used instead of plain
163 * realloc if an alternative allocation strategy is needed upon failure
164 * to expand space; for example, reallocation of a buffer that must be
165 * memory-aligned or cleared. You can use realloc_in_place to trigger
166 * these alternatives only when needed.
167 *
168 * Returns p if successful; otherwise null.
169 */
170void* dlrealloc_in_place(void *, size_t);
171
172/*
173 * memalign(size_t alignment, size_t n);
174 * Returns a pointer to a newly allocated chunk of n bytes, aligned
175 * in accord with the alignment argument.
176 *
177 * The alignment argument should be a power of two. If the argument is
178 * not a power of two, the nearest greater power is used.
179 * 8-byte alignment is guaranteed by normal malloc calls, so don't
180 * bother calling memalign with an argument of 8 or less.
181 *
182 * Overreliance on memalign is a sure way to fragment space.
183 */
184void* dlmemalign(size_t, size_t);
185
186/*
187 * int posix_memalign(void** pp, size_t alignment, size_t n);
188 * Allocates a chunk of n bytes, aligned in accord with the alignment
189 * argument. Differs from memalign only in that it (1) assigns the
190 * allocated memory to *pp rather than returning it, (2) fails and
191 * returns EINVAL if the alignment is not a power of two (3) fails and
192 * returns ENOMEM if memory cannot be allocated.
193 */
194int dlposix_memalign(void **, size_t, size_t);
195
196/*
197 * valloc(size_t n);
198 * Equivalent to memalign(pagesize, n), where pagesize is the page
199 * size of the system. If the pagesize is unknown, 4096 is used.
200 */
201void* dlvalloc(size_t);
202
203/*
204 * mallopt(int parameter_number, int parameter_value)
205 * Sets tunable parameters The format is to provide a
206 * (parameter-number, parameter-value) pair. mallopt then sets the
207 * corresponding parameter to the argument value if it can (i.e., so
208 * long as the value is meaningful), and returns 1 if successful else
209 * 0. SVID/XPG/ANSI defines four standard param numbers for mallopt,
210 * normally defined in malloc.h. None of these are use in this malloc,
211 * so setting them has no effect. But this malloc also supports other
212 * options in mallopt:
213 *
214 * Symbol param # default allowed param values
215 * M_TRIM_THRESHOLD -1 2*1024*1024 any (-1U disables trimming)
216 * M_GRANULARITY -2 page size any power of 2 >= page size
217 * M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support)
218 */
219int dlmallopt(int, int);
220
221#define M_TRIM_THRESHOLD (-1)
222#define M_GRANULARITY (-2)
223#define M_MMAP_THRESHOLD (-3)
224
225
226/*
227 * malloc_footprint();
228 * Returns the number of bytes obtained from the system. The total
229 * number of bytes allocated by malloc, realloc etc., is less than this
230 * value. Unlike mallinfo, this function returns only a precomputed
231 * result, so can be called frequently to monitor memory consumption.
232 * Even if locks are otherwise defined, this function does not use them,
233 * so results might not be up to date.
234 */
235size_t dlmalloc_footprint(void);
236
237/*
238 * malloc_max_footprint();
239 * Returns the maximum number of bytes obtained from the system. This
240 * value will be greater than current footprint if deallocated space
241 * has been reclaimed by the system. The peak number of bytes allocated
242 * by malloc, realloc etc., is less than this value. Unlike mallinfo,
243 * this function returns only a precomputed result, so can be called
244 * frequently to monitor memory consumption. Even if locks are
245 * otherwise defined, this function does not use them, so results might
246 * not be up to date.
247 */
248size_t dlmalloc_max_footprint(void);
249
250/*
251 * malloc_footprint_limit();
252 * Returns the number of bytes that the heap is allowed to obtain from
253 * the system, returning the last value returned by
254 * malloc_set_footprint_limit, or the maximum size_t value if
255 * never set. The returned value reflects a permission. There is no
256 * guarantee that this number of bytes can actually be obtained from
257 * the system.
258 */
259size_t dlmalloc_footprint_limit(void);
260
261/*
262 * malloc_set_footprint_limit();
263 * Sets the maximum number of bytes to obtain from the system, causing
264 * failure returns from malloc and related functions upon attempts to
265 * exceed this value. The argument value may be subject to page
266 * rounding to an enforceable limit; this actual value is returned.
267 * Using an argument of the maximum possible size_t effectively
268 * disables checks. If the argument is less than or equal to the
269 * current malloc_footprint, then all future allocations that require
270 * additional system memory will fail. However, invocation cannot
271 * retroactively deallocate existing used memory.
272 */
273size_t dlmalloc_set_footprint_limit(size_t bytes);
274
275/*
276 * malloc_inspect_all(void(*handler)(void *start,
277 * void *end,
278 * size_t used_bytes,
279 * void* callback_arg),
280 * void* arg);
281 * Traverses the heap and calls the given handler for each managed
282 * region, skipping all bytes that are (or may be) used for bookkeeping
283 * purposes. Traversal does not include include chunks that have been
284 * directly memory mapped. Each reported region begins at the start
285 * address, and continues up to but not including the end address. The
286 * first used_bytes of the region contain allocated data. If
287 * used_bytes is zero, the region is unallocated. The handler is
288 * invoked with the given callback argument. If locks are defined, they
289 * are held during the entire traversal. It is a bad idea to invoke
290 * other malloc functions from within the handler.
291 *
292 * For example, to count the number of in-use chunks with size greater
293 * than 1000, you could write:
294 * static int count = 0;
295 * void count_chunks(void* start, void* end, size_t used, void* arg) {
296 * if (used >= 1000) ++count;
297 * }
298 * then:
299 * malloc_inspect_all(count_chunks, NULL);
300 *
301 * malloc_inspect_all is compiled only if MALLOC_INSPECT_ALL is defined.
302 */
303void dlmalloc_inspect_all(void ( *handler )(void *, void *, size_t, void *),
304 void *arg);
305
306#if !NO_MALLINFO
307
308/*
309 * mallinfo()
310 * Returns (by copy) a struct containing various summary statistics:
311 *
312 * arena: current total non-mmapped bytes allocated from system
313 * ordblks: the number of free chunks
314 * smblks: always zero.
315 * hblks: current number of mmapped regions
316 * hblkhd: total bytes held in mmapped regions
317 * usmblks: the maximum total allocated space. This will be greater
318 * than current total if trimming has occurred.
319 * fsmblks: always zero
320 * uordblks: current total allocated space (normal or mmapped)
321 * fordblks: total free space
322 * keepcost: the maximum number of bytes that could ideally be released
323 * back to system via malloc_trim. ("ideally" means that
324 * it ignores page restrictions etc.)
325 *
326 * Because these fields are ints, but internal bookkeeping may
327 * be kept as longs, the reported values may wrap around zero and
328 * thus be inaccurate.
329 */
330
331struct mallinfo dlmallinfo(void);
332#endif /* NO_MALLINFO */
333
334/*
335 * independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
336 *
337 * independent_calloc is similar to calloc, but instead of returning a
338 * single cleared space, it returns an array of pointers to n_elements
339 * independent elements that can hold contents of size elem_size, each
340 * of which starts out cleared, and can be independently freed,
341 * realloc'ed etc. The elements are guaranteed to be adjacently
342 * allocated (this is not guaranteed to occur with multiple callocs or
343 * mallocs), which may also improve cache locality in some
344 * applications.
345 *
346 * The "chunks" argument is optional (i.e., may be null, which is
347 * probably the most typical usage). If it is null, the returned array
348 * is itself dynamically allocated and should also be freed when it is
349 * no longer needed. Otherwise, the chunks array must be of at least
350 * n_elements in length. It is filled in with the pointers to the
351 * chunks.
352 *
353 * In either case, independent_calloc returns this pointer array, or
354 * null if the allocation failed. If n_elements is zero and "chunks"
355 * is null, it returns a chunk representing an array with zero elements
356 * (which should be freed if not wanted).
357 *
358 * Each element must be freed when it is no longer needed. This can be
359 * done all at once using bulk_free.
360 *
361 * independent_calloc simplifies and speeds up implementations of many
362 * kinds of pools. It may also be useful when constructing large data
363 * structures that initially have a fixed number of fixed-sized nodes,
364 * but the number is not known at compile time, and some of the nodes
365 * may later need to be freed. For example:
366 *
367 * struct Node { int item; struct Node* next; };
368 *
369 * struct Node* build_list() {
370 * struct Node** pool;
371 * int n = read_number_of_nodes_needed();
372 * if (n <= 0) return 0;
373 * pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
374 * if (pool == 0) die();
375 * // organize into a linked list...
376 * struct Node* first = pool[0];
377 * for (i = 0; i < n-1; ++i)
378 * pool[i]->next = pool[i+1];
379 * free(pool); // Can now free the array (or not, if it is needed later)
380 * return first;
381 * }
382 */
383void** dlindependent_calloc(size_t, size_t, void **);
384
385/*
386 * independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
387 *
388 * independent_comalloc allocates, all at once, a set of n_elements
389 * chunks with sizes indicated in the "sizes" array. It returns
390 * an array of pointers to these elements, each of which can be
391 * independently freed, realloc'ed etc. The elements are guaranteed to
392 * be adjacently allocated (this is not guaranteed to occur with
393 * multiple callocs or mallocs), which may also improve cache locality
394 * in some applications.
395 *
396 * The "chunks" argument is optional (i.e., may be null). If it is null
397 * the returned array is itself dynamically allocated and should also
398 * be freed when it is no longer needed. Otherwise, the chunks array
399 * must be of at least n_elements in length. It is filled in with the
400 * pointers to the chunks.
401 *
402 * In either case, independent_comalloc returns this pointer array, or
403 * null if the allocation failed. If n_elements is zero and chunks is
404 * null, it returns a chunk representing an array with zero elements
405 * (which should be freed if not wanted).
406 *
407 * Each element must be freed when it is no longer needed. This can be
408 * done all at once using bulk_free.
409 *
410 * independent_comallac differs from independent_calloc in that each
411 * element may have a different size, and also that it does not
412 * automatically clear elements.
413 *
414 * independent_comalloc can be used to speed up allocation in cases
415 * where several structs or objects must always be allocated at the
416 * same time. For example:
417 *
418 * struct Head { ... }
419 * struct Foot { ... }
420 *
421 * void send_message(char* msg) {
422 * int msglen = strlen(msg);
423 * size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
424 * void* chunks[3];
425 * if (independent_comalloc(3, sizes, chunks) == 0)
426 * die();
427 * struct Head* head = (struct Head*)(chunks[0]);
428 * char* body = (char*)(chunks[1]);
429 * struct Foot* foot = (struct Foot*)(chunks[2]);
430 * // ...
431 * }
432 *
433 * In general though, independent_comalloc is worth using only for
434 * larger values of n_elements. For small values, you probably won't
435 * detect enough difference from series of malloc calls to bother.
436 *
437 * Overuse of independent_comalloc can increase overall memory usage,
438 * since it cannot reuse existing noncontiguous small chunks that
439 * might be available for some of the elements.
440 */
441void** dlindependent_comalloc(size_t, size_t *, void **);
442
443/*
444 * bulk_free(void* array[], size_t n_elements)
445 * Frees and clears (sets to null) each non-null pointer in the given
446 * array. This is likely to be faster than freeing them one-by-one.
447 * If footers are used, pointers that have been allocated in different
448 * mspaces are not freed or cleared, and the count of all such pointers
449 * is returned. For large arrays of pointers with poor locality, it
450 * may be worthwhile to sort this array before calling bulk_free.
451 */
452size_t dlbulk_free(void **, size_t n_elements);
453
454/*
455 * pvalloc(size_t n);
456 * Equivalent to valloc(minimum-page-that-holds(n)), that is,
457 * round up n to nearest pagesize.
458 */
459void* dlpvalloc(size_t);
460
461/*
462 * malloc_trim(size_t pad);
463 *
464 * If possible, gives memory back to the system (via negative arguments
465 * to sbrk) if there is unused memory at the `high' end of the malloc
466 * pool or in unused MMAP segments. You can call this after freeing
467 * large blocks of memory to potentially reduce the system-level memory
468 * requirements of a program. However, it cannot guarantee to reduce
469 * memory. Under some allocation patterns, some large free blocks of
470 * memory will be locked between two used chunks, so they cannot be
471 * given back to the system.
472 *
473 * The `pad' argument to malloc_trim represents the amount of free
474 * trailing space to leave untrimmed. If this argument is zero, only
475 * the minimum amount of memory to maintain internal data structures
476 * will be left. Non-zero arguments can be supplied to maintain enough
477 * trailing space to service future expected allocations without having
478 * to re-obtain memory from the system.
479 *
480 * Malloc_trim returns 1 if it actually released any memory, else 0.
481 */
482int dlmalloc_trim(size_t);
483
484/*
485 * malloc_stats();
486 * Prints on stderr the amount of space obtained from the system (both
487 * via sbrk and mmap), the maximum amount (which may be more than
488 * current if malloc_trim and/or munmap got called), and the current
489 * number of bytes allocated via malloc (or realloc, etc) but not yet
490 * freed. Note that this is the number of bytes allocated, not the
491 * number requested. It will be larger than the number requested
492 * because of alignment and bookkeeping overhead. Because it includes
493 * alignment wastage as being in use, this figure may be greater than
494 * zero even when no user-level chunks are allocated.
495 *
496 * The reported current and maximum system memory can be inaccurate if
497 * a program makes other calls to system memory allocation functions
498 * (normally sbrk) outside of malloc.
499 *
500 * malloc_stats prints only the most commonly interesting statistics.
501 * More information can be obtained by calling mallinfo.
502 *
503 * malloc_stats is not compiled if NO_MALLOC_STATS is defined.
504 */
505void dlmalloc_stats(void);
506
507#endif /* !ONLY_MSPACES */
508
509/*
510 * malloc_usable_size(void* p);
511 *
512 * Returns the number of bytes you can actually use in
513 * an allocated chunk, which may be more than you requested (although
514 * often not) due to alignment and minimum size constraints.
515 * You can use this many bytes without worrying about
516 * overwriting other allocated objects. This is not a particularly great
517 * programming practice. malloc_usable_size can be more useful in
518 * debugging and assertions, for example:
519 *
520 * p = malloc(n);
521 * assert(malloc_usable_size(p) >= 256);
522 */
523size_t dlmalloc_usable_size(const void *);
524
525#if MSPACES
526
527/*
528 * mspace is an opaque type representing an independent
529 * region of space that supports mspace_malloc, etc.
530 */
531typedef void *mspace;
532
533/*
534 * create_mspace creates and returns a new independent space with the
535 * given initial capacity, or, if 0, the default granularity size. It
536 * returns null if there is no system memory available to create the
537 * space. If argument locked is non-zero, the space uses a separate
538 * lock to control access. The capacity of the space will grow
539 * dynamically as needed to service mspace_malloc requests. You can
540 * control the sizes of incremental increases of this space by
541 * compiling with a different DEFAULT_GRANULARITY or dynamically
542 * setting with mallopt(M_GRANULARITY, value).
543 */
544mspace create_mspace(size_t capacity, int locked);
545
546/*
547 * destroy_mspace destroys the given space, and attempts to return all
548 * of its memory back to the system, returning the total number of
549 * bytes freed. After destruction, the results of access to all memory
550 * used by the space become undefined.
551 */
552size_t destroy_mspace(mspace msp);
553
554/*
555 * create_mspace_with_base uses the memory supplied as the initial base
556 * of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
557 * space is used for bookkeeping, so the capacity must be at least this
558 * large. (Otherwise 0 is returned.) When this initial space is
559 * exhausted, additional memory will be obtained from the system.
560 * Destroying this space will deallocate all additionally allocated
561 * space (if possible) but not the initial base.
562 */
563mspace create_mspace_with_base(void *base, size_t capacity, int locked);
564
565/*
566 * mspace_track_large_chunks controls whether requests for large chunks
567 * are allocated in their own untracked mmapped regions, separate from
568 * others in this mspace. By default large chunks are not tracked,
569 * which reduces fragmentation. However, such chunks are not
570 * necessarily released to the system upon destroy_mspace. Enabling
571 * tracking by setting to true may increase fragmentation, but avoids
572 * leakage when relying on destroy_mspace to release all memory
573 * allocated using this space. The function returns the previous
574 * setting.
575 */
576int mspace_track_large_chunks(mspace msp, int enable);
577
578#if !NO_MALLINFO
579
580/*
581 * mspace_mallinfo behaves as mallinfo, but reports properties of
582 * the given space.
583 */
584struct mallinfo mspace_mallinfo(mspace msp);
585#endif /* NO_MALLINFO */
586
587/*
588 * An alias for mallopt.
589 */
590int mspace_mallopt(int, int);
591
592/*
593 * The following operate identically to their malloc counterparts
594 * but operate only for the given mspace argument
595 */
596void* mspace_malloc(mspace msp, size_t bytes);
597void mspace_free(mspace msp, void *mem);
598void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
599void* mspace_realloc(mspace msp, void *mem, size_t newsize);
600void* mspace_realloc_in_place(mspace msp, void *mem, size_t newsize);
601void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);
602void** mspace_independent_calloc(mspace msp, size_t n_elements,
603 size_t elem_size, void *chunks[]);
604void** mspace_independent_comalloc(mspace msp, size_t n_elements,
605 size_t sizes[], void *chunks[]);
606size_t mspace_bulk_free(mspace msp, void **, size_t n_elements);
607size_t mspace_usable_size(const void *mem);
608void mspace_malloc_stats(mspace msp);
609int mspace_trim(mspace msp, size_t pad);
610size_t mspace_footprint(mspace msp);
611size_t mspace_max_footprint(mspace msp);
612size_t mspace_footprint_limit(mspace msp);
613size_t mspace_set_footprint_limit(mspace msp, size_t bytes);
614void mspace_inspect_all(mspace msp,
615 void ( *handler )(void *, void *, size_t, void *),
616 void *arg);
617#endif /* MSPACES */
618
619#ifdef __cplusplus
620}; /* end of extern "C" */
621#endif
622
623#endif /* MALLOC_280_H */
#define dlrealloc_in_place
Definition malloc.c:830
#define MALLINFO_FIELD_TYPE
Definition malloc.c:712
#define dlmallinfo
Definition malloc.c:5492
#define dlrealloc
Definition malloc.h:57
#define dlmalloc_set_footprint_limit
Definition malloc.h:68
#define dlindependent_calloc
Definition malloc.h:70
#define dlmallopt
Definition malloc.h:61
#define dlmemalign
Definition malloc.h:55
#define dlmalloc_footprint_limit
Definition malloc.h:67
#define dlmalloc_stats
Definition malloc.h:63
#define dlmalloc_max_footprint
Definition malloc.h:66
#define dlbulk_free
Definition malloc.h:72
#define dlmalloc_trim
Definition malloc.h:62
#define dlmalloc
Definition malloc.h:54
#define dlpvalloc
Definition malloc.h:59
#define dlfree
Definition malloc.h:53
#define dlindependent_comalloc
Definition malloc.h:71
#define dlmalloc_usable_size
Definition malloc.h:64
#define dlmalloc_inspect_all
Definition malloc.h:69
#define dlposix_memalign
Definition malloc.h:56
#define dlmalloc_footprint
Definition malloc.h:65
#define dlcalloc
Definition malloc.h:52
#define dlvalloc
Definition malloc.h:58
MALLINFO_FIELD_TYPE hblkhd
Definition malloc.c:776
MALLINFO_FIELD_TYPE ordblks
Definition malloc.c:773
MALLINFO_FIELD_TYPE smblks
Definition malloc.c:774
MALLINFO_FIELD_TYPE fsmblks
Definition malloc.c:778
MALLINFO_FIELD_TYPE hblks
Definition malloc.c:775
MALLINFO_FIELD_TYPE arena
Definition malloc.c:772
MALLINFO_FIELD_TYPE keepcost
Definition malloc.c:781
MALLINFO_FIELD_TYPE fordblks
Definition malloc.c:780
MALLINFO_FIELD_TYPE uordblks
Definition malloc.c:779
MALLINFO_FIELD_TYPE usmblks
Definition malloc.c:777