Lines Matching +full:mem +full:- +full:array
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
35 * Chris Kingsley, kingsley@cit-20.
40 * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long.
60 * Pre-allocate mmap'ed pages
100 * The array of supported page sizes is provided by the user, i.e., the
102 * the array before making its first call to allocate storage. The array
110 return (((caddr_t)cp - sizeof(union overhead))); in cp2op()
132 while (nbytes > amt - sizeof(*op)) { in __crt_malloc()
148 nextf[bucket] = op->ov_next; in __crt_malloc()
149 op->ov_magic = MAGIC; in __crt_malloc()
150 op->ov_index = bucket; in __crt_malloc()
173 void *mem, *ov; in __crt_aligned_alloc_offset() local
179 offset &= align - 1; in __crt_aligned_alloc_offset()
180 mem = __crt_malloc(size + align + offset + sizeof(union overhead)); in __crt_aligned_alloc_offset()
181 if (mem == NULL) in __crt_aligned_alloc_offset()
183 x = roundup2((uintptr_t)mem + sizeof(union overhead), align); in __crt_aligned_alloc_offset()
187 ov1.ov_index = x - (uintptr_t)mem + sizeof(union overhead); in __crt_aligned_alloc_offset()
211 if (amt > pagepool_end - pagepool_start) in morecore()
224 while (--nblks > 0) { in morecore()
225 op->ov_next = (union overhead *)((caddr_t)op + sz); in morecore()
241 op = op1.ov_magic == AMAGIC ? (void *)((caddr_t)cp - op1.ov_index) : in __crt_free()
243 if (op->ov_magic != MAGIC) in __crt_free()
245 size = op->ov_index; in __crt_free()
246 op->ov_next = nextf[size]; /* also clobbers ov_magic */ in __crt_free()
261 if (op->ov_magic != MAGIC) in __crt_realloc()
262 return (NULL); /* Double-free or bad argument */ in __crt_realloc()
263 i = op->ov_index; in __crt_realloc()
266 onb -= sizeof(*op); in __crt_realloc()
268 onb += pagesz - sizeof(*op); in __crt_realloc()
273 i -= sizeof(*op); in __crt_realloc()
275 i += pagesz - sizeof(*op); in __crt_realloc()
292 if (pagepool_end - pagepool_start > pagesz) { in morepages()
294 if (munmap(addr, pagepool_end - addr) != 0) { in morepages()
303 offset = (uintptr_t)pagepool_start - rounddown2( in morepages()
307 MAP_ANON | MAP_PRIVATE, -1, 0); in morepages()