Lines Matching full:chunk

28      Return a pointer to a newly allocated chunk of at least n bytes, or null
31 Release the chunk of memory pointed to by p, or no effect if p is null.
33 Return a pointer to a chunk of size n that contains the same data
34 as does chunk p up to the minimum of (n, p's size) bytes, or null
38 size argument of zero (re)allocates a minimum-sized chunk.
40 Return a pointer to a newly allocated chunk of n bytes, aligned
60 chunk p. This may or may not report more bytes than were requested,
84 Minimum overhead per allocated chunk: 4 or 8 bytes
85 Each malloced chunk has a hidden overhead of 4 bytes holding size
91 When a chunk is freed, 12 (for 4byte ptrs) or 20 (for 8 byte
104 represent chunk sizes. `Possibly signed' is due to the fact
111 Maximum overhead wastage per allocated chunk: normally 15 bytes
277 attempt to check every non-mmapped allocated and free chunk in the
296 of chunk sizes. On a 64-bit machine, you can reduce malloc
1136 INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */
1154 in the front of each chunk and at the end. This makes
1159 An allocated chunk looks like this:
1162 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1163 | Size of previous chunk, if allocated | |
1165 | Size of chunk, in bytes |P|
1172 | Size of chunk |
1176 Where "chunk" is the front of the chunk for the purpose of most of
1178 user. "Nextchunk" is the beginning of the next contiguous chunk.
1186 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1187 | Size of previous chunk |
1189 `head:' | Size of chunk, in bytes |P|
1191 | Forward pointer to next chunk in list |
1193 | Back pointer to previous chunk in list |
1199 `foot:' | Size of chunk, in bytes |
1203 chunk size (which is always a multiple of two words), is an in-use
1204 bit for the *previous* chunk. If that bit is *clear*, then the
1205 word before the current chunk size contains the previous chunk
1206 size, and can be used to find the front of the previous chunk.
1207 (The very first chunk allocated always has this bit set,
1210 Note that the `foot' of the current chunk is actually represented
1211 as the prev_size of the NEXT chunk. (This makes it easier to
1216 1. The special chunk `top', which doesn't bother using the
1218 next contiguous chunk that would have to index off it. (After
1225 never merged or traversed from any other chunk, they have no
1235 consolidated chunk physically borders another one. Chunks in
1237 approximately least recently used chunk.
1247 order, which tends to give each chunk an equal opportunity to be
1251 * `top': The top-most available chunk (i.e., the one bordering the
1253 included in any bin, is used only if no other chunk is
1258 most recently split (non-top) chunk. This bin is checked
1299 Physical chunk operations
1303 /* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */
1307 /* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap() */
1326 /* Treat space at ptr + offset as a chunk */
1342 /* extract inuse bit of previous chunk */
1346 /* check for mmap()'ed chunk */
1350 /* set/clear chunk as in use without otherwise disturbing */
1388 /* Set size at footer (only when chunk is not in use) */
1446 #define top (bin_at(0)->fd) /* The topmost chunk */
1601 /* No checkable chunk is mmapped */
1661 if an inuse chunk borders them and debug is on, it's worth doing them.
1700 /* ... and was allocated at front of an available chunk */
1730 Place chunk p of size s in its bin, in size order,
1765 /* take a chunk off a list */
1812 * there is no following chunk whose prev_size field could be used.
1837 * in the prev_size field of the chunk; normally it is zero,
1923 Extend the top-most chunk by obtaining memory from system.
1937 INTERNAL_SIZE_T top_size; /* new size of top chunk */
1976 /* Guarantee alignment of first new chunk made from this space */
2054 a chunk of exactly the right size is found, it is taken.
2056 2. The most recently remaindered chunk is used if it is big
2059 the remainder of the chunk used for the previous such request
2066 chunk big enough to fulfill the request, and splitting off
2069 recently used) chunk that fits is selected.
2071 4. If large enough, the chunk bordering the end of memory
2075 chunk since it can be extended to be as large as necessary
2094 chunk. (The implementation invariant is that prev_inuse is
2095 always true of any allocated chunk; i.e., that each allocated
2096 chunk borders either a previously allocated and still in-use chunk,
2107 mchunkptr victim; /* inspected/selected chunk */
2218 search for best fitting chunk by scanning bins in blockwidth units.
2247 /* Find and use first big enough chunk ... */
2309 /* Try to use top chunk */
2348 2. If the chunk was allocated via mmap, it is release via munmap().
2350 3. If a returned chunk borders the current high end of memory,
2368 mchunkptr p; /* chunk corresponding to mem */
2372 mchunkptr next; /* next contiguous chunk */
2374 INTERNAL_SIZE_T prevsz; /* size of previous contiguous chunk */
2468 chunk can be extended, it is, else a malloc-copy-free sequence is
2469 taken. There are several different ways that a chunk could be
2472 * Extending forward into following adjacent free chunk.
2478 size argument of zero (re)allocates a minimum-sized chunk.
2484 The old unix realloc convention of allowing the last-free'd chunk
2502 mchunkptr oldp; /* chunk corresponding to oldmem */
2505 mchunkptr newp; /* chunk to return */
2509 mchunkptr next; /* next contiguous chunk after oldp */
2512 mchunkptr prev; /* previous contiguous chunk before oldp */
2579 /* Forward into next chunk */
2621 /* into next chunk */
2653 /* Avoid copy if newp is next chunk after oldp. */
2654 /* (This can only happen when new chunk is sbrk'ed.) */
2670 split: /* split off extra room in old or expanded chunk */
2699 within that chunk that meets the alignment request, and then
2721 mchunkptr p; /* corresponding chunk */
2723 mchunkptr newp; /* chunk to return */
2735 /* Otherwise, ensure that it is at least a minimum chunk size */
2758 Find an aligned spot inside chunk.
2759 Since we need to give back leading space in a chunk of at
2846 calloc calls malloc, then zeroes out the allocated chunk.
3004 allocated chunk, which may be more than you requested (although