Lines Matching +full:max +full:- +full:size

29 #include "nano-malloc.h"
42 * already aligned - only ask for extra padding after we know we
56 return (void *)-1; in __malloc_sbrk_aligned()
61 return (void *)-1; in __malloc_sbrk_aligned()
65 /* sbrk returns -1 if fail to allocate */ in __malloc_sbrk_aligned()
66 if (p == (void *)-1) in __malloc_sbrk_aligned()
75 align_p = __align_up(p + MALLOC_HEAD, MALLOC_CHUNK_ALIGN) - MALLOC_HEAD; in __malloc_sbrk_aligned()
85 intptr_t adjust = align_p - p; in __malloc_sbrk_aligned()
88 return (void *) -1; in __malloc_sbrk_aligned()
104 size_t add_size = MAX(MALLOC_MINSIZE, new_size - _size(c)); in __malloc_grow_chunk()
112 /* Set size and return */ in __malloc_grow_chunk()
117 if (heap != (char *) -1) in __malloc_grow_chunk()
147 for (p = &__malloc_free_list; (r = *p) != NULL; p = &r->next) in malloc()
151 size_t rem = _size(r) - alloc_size; in malloc()
155 /* Find a chunk_t that much larger than required size, break in malloc()
161 s->next = r->next; in malloc()
168 /* Find a chunk_t that is exactly the size or slightly bigger in malloc()
169 * than requested size, just return this chunk_t in malloc()
171 *p = r->next; in malloc()
175 if (!r->next && __malloc_grow_chunk(r, alloc_size)) in malloc()
177 /* Grow the last chunk in memory to the requested size, in malloc()
180 *p = r->next; in malloc()
190 /* sbrk returns -1 if fail to allocate */ in malloc()
191 if (blob == (void *)-1) in malloc()
205 memset(ptr, '\0', alloc_size - MALLOC_HEAD); in malloc()
212 #pragma GCC diagnostic ignored "-Wmissing-attributes"
236 for (r = __malloc_free_list; r; r = r->next) { in __malloc_validate()
238 assert (r->next == NULL || (char *) r + _size(r) <= (char *) r->next); in __malloc_validate()