Lines Matching full:chunk
221 INTERNAL_SIZE_T prev_size; /* Size of previous chunk (if free). */
239 in the front of each chunk and at the end. This makes
244 An allocated chunk looks like this:
247 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
248 | Size of previous chunk, if allocated | |
250 | Size of chunk, in bytes |P|
257 | Size of chunk |
261 Where "chunk" is the front of the chunk for the purpose of most of
263 user. "Nextchunk" is the beginning of the next contiguous chunk.
271 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
272 | Size of previous chunk |
274 `head:' | Size of chunk, in bytes |P|
276 | Forward pointer to next chunk in list |
278 | Back pointer to previous chunk in list |
284 `foot:' | Size of chunk, in bytes |
288 chunk size (which is always a multiple of two words), is an in-use
289 bit for the *previous* chunk. If that bit is *clear*, then the
290 word before the current chunk size contains the previous chunk
291 size, and can be used to find the front of the previous chunk.
292 (The very first chunk allocated always has this bit set,
295 Note that the `foot' of the current chunk is actually represented
296 as the prev_size of the NEXT chunk. (This makes it easier to
301 1. The special chunk `top', which doesn't bother using the
303 next contiguous chunk that would have to index off it. (After
310 never merged or traversed from any other chunk, they have no
320 consolidated chunk physically borders another one. Chunks in
322 approximately least recently used chunk.
332 order, which tends to give each chunk an equal opportunity to be
336 * `top': The top-most available chunk (i.e., the one bordering the
338 included in any bin, is used only if no other chunk is
343 most recently split (non-top) chunk. This bin is checked
380 Physical chunk operations
384 /* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */
388 /* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap() */
407 /* Treat space at ptr + offset as a chunk */
423 /* extract inuse bit of previous chunk */
427 /* check for mmap()'ed chunk */
431 /* set/clear chunk as in use without otherwise disturbing */
469 /* Set size at footer (only when chunk is not in use) */
527 #define top (av_[2]) /* The topmost chunk */
736 /* No checkable chunk is mmapped */
796 if an inuse chunk borders them and debug is on, it's worth doing them.
835 /* ... and was allocated at front of an available chunk */
865 Place chunk p of size s in its bin, in size order,
900 /* take a chunk off a list */
947 * there is no following chunk whose prev_size field could be used.
972 * in the prev_size field of the chunk; normally it is zero,
1058 Extend the top-most chunk by obtaining memory from system.
1072 INTERNAL_SIZE_T top_size; /* new size of top chunk */
1111 /* Guarantee alignment of first new chunk made from this space */
1189 a chunk of exactly the right size is found, it is taken.
1191 2. The most recently remaindered chunk is used if it is big
1194 the remainder of the chunk used for the previous such request
1201 chunk big enough to fulfill the request, and splitting off
1204 recently used) chunk that fits is selected.
1206 4. If large enough, the chunk bordering the end of memory
1210 chunk since it can be extended to be as large as necessary
1229 chunk. (The implementation invariant is that prev_inuse is
1230 always true of any allocated chunk; i.e., that each allocated
1231 chunk borders either a previously allocated and still in-use chunk,
1242 mchunkptr victim; /* inspected/selected chunk */
1364 search for best fitting chunk by scanning bins in blockwidth units.
1393 /* Find and use first big enough chunk ... */
1455 /* Try to use top chunk */
1494 2. If the chunk was allocated via mmap, it is release via munmap().
1496 3. If a returned chunk borders the current high end of memory,
1514 mchunkptr p; /* chunk corresponding to mem */
1518 mchunkptr next; /* next contiguous chunk */
1520 INTERNAL_SIZE_T prevsz; /* size of previous contiguous chunk */
1620 chunk can be extended, it is, else a malloc-copy-free sequence is
1621 taken. There are several different ways that a chunk could be
1624 * Extending forward into following adjacent free chunk.
1630 size argument of zero (re)allocates a minimum-sized chunk.
1636 The old unix realloc convention of allowing the last-free'd chunk
1654 mchunkptr oldp; /* chunk corresponding to oldmem */
1657 mchunkptr newp; /* chunk to return */
1661 mchunkptr next; /* next contiguous chunk after oldp */
1664 mchunkptr prev; /* previous contiguous chunk before oldp */
1742 /* Forward into next chunk */
1784 /* into next chunk */
1816 /* Avoid copy if newp is next chunk after oldp. */
1817 /* (This can only happen when new chunk is sbrk'ed.) */
1833 split: /* split off extra room in old or expanded chunk */
1862 within that chunk that meets the alignment request, and then
1884 mchunkptr p; /* corresponding chunk */
1886 mchunkptr newp; /* chunk to return */
1905 /* Otherwise, ensure that it is at least a minimum chunk size */
1952 /* Fall through to original NULL check and chunk splitting logic */
1969 Find an aligned spot inside chunk.
1970 Since we need to give back leading space in a chunk of at
2057 calloc calls malloc, then zeroes out the allocated chunk.
2225 allocated chunk, which may be more than you requested (although