Lines Matching +full:max +full:- +full:size
65 /* --------------------------------------
66 * | size |
67 * chunk->| When allocated: data |
70 * --------------------------------------
73 * address of 'size' may not be aligned to MALLOC_CHUNK_ALIGN. But it
76 * size is set so that a chunk starting at chunk+size will be
79 * We can't use a single struct containing both size and next as that
80 * may insert padding between the size and pointer fields when
85 size_t size; member
104 /* nominal "page size" */
107 /* Minimum allocation size */
110 /* Maximum allocation size */
111 #define MALLOC_MAXSIZE (SIZE_MAX - (MALLOC_HEAD + 2*MALLOC_CHUNK_ALIGN))
115 return (size_t *) ((char *) chunk - MALLOC_HEAD); in _size_ref()
123 static inline void _set_size(chunk_t *chunk, size_t size) in _set_size() argument
125 *_size_ref(chunk) = size; in _set_size()
139 /* Work around compiler optimizing away stores to 'size' field before
175 return (void *) ((char *) c - MALLOC_HEAD); in chunk_to_blob()
178 /* end of chunk -- address of first byte past chunk storage */
186 /* next chunk in memory -- address of chunk header past this chunk */
193 /* chunk size needed to hold 'malloc_size' bytes */
204 malloc_size += (MALLOC_CHUNK_ALIGN - MALLOC_HEAD_ALIGN); in chunk_size()
206 /* Make sure the requested size is big enough to hold a free chunk */ in chunk_size()
207 malloc_size = MAX(MALLOC_MINSIZE, malloc_size); in chunk_size()
215 return _size(c) - MALLOC_HEAD; in chunk_usable()
218 /* assign 'size' to the specified chunk and return it to the free
221 make_free_chunk(chunk_t *c, size_t size) in make_free_chunk() argument
223 _set_size(c, size); in make_free_chunk()