Lines Matching refs:ptr

100 	void *ptr;  in initial_allocation()  local
125 ptr = (void *)((caddr_t)base + bucketnum * SUBCHUNKSIZE); in initial_allocation()
128 bp->free_list = ptr; in initial_allocation()
130 void *next = (void *)((caddr_t)ptr + size); in initial_allocation()
131 *(void **)ptr = next; in initial_allocation()
132 ptr = next; in initial_allocation()
134 *(void **)ptr = NULL; in initial_allocation()
137 ptr = (void *)((caddr_t)base + bucketnum * SUBCHUNKSIZE); in initial_allocation()
139 bp->free_list = ptr; in initial_allocation()
141 ptr = (void *)((caddr_t)ptr + 2 * SUBCHUNKSIZE); in initial_allocation()
144 bp->free_list = ptr; in initial_allocation()
146 ASSERT(((caddr_t)ptr - (caddr_t)base + 4 * SUBCHUNKSIZE) == BASE_SIZE); in initial_allocation()
187 void *ptr; in lmalloc() local
201 ptr = mmap((void *)CHUNKSIZE, size, prot, in lmalloc()
203 if (ptr == MAP_FAILED) in lmalloc()
204 ptr = NULL; in lmalloc()
205 return (ptr); in lmalloc()
223 if ((ptr = bp->free_list) == NULL) { in lmalloc()
238 ptr = mmap((void *)CHUNKSIZE, bsize, prot, in lmalloc()
240 if (ptr != MAP_FAILED) in lmalloc()
249 bp->free_list = ptr; in lmalloc()
251 void *next = (void *)((caddr_t)ptr + size); in lmalloc()
252 *(void **)ptr = next; in lmalloc()
253 ptr = next; in lmalloc()
255 *(void **)ptr = NULL; in lmalloc()
256 ptr = bp->free_list; in lmalloc()
258 bp->free_list = *(void **)ptr; in lmalloc()
266 *(void **)ptr = NULL; in lmalloc()
267 return (ptr); in lmalloc()
271 lfree(void *ptr, size_t size) in lfree() argument
282 if (((uintptr_t)ptr & (CHUNKSIZE - 1)) != 0) in lfree()
284 (void) munmap(ptr, size); in lfree()
296 if (((uintptr_t)ptr & (size - 1)) != 0) in lfree()
302 (void) memset(ptr, 0, size); in lfree()
310 *(void **)ptr = bp->free_list; in lfree()
311 bp->free_list = ptr; in lfree()
348 private_header_t *ptr; in libc_malloc() local
350 size = (size_t)MINSIZE << getbucketnum(size + sizeof (*ptr)); in libc_malloc()
351 if ((ptr = lmalloc(size)) == NULL) in libc_malloc()
353 ptr->private_size = size; in libc_malloc()
354 return (ptr + 1); in libc_malloc()
360 private_header_t *ptr; in libc_realloc() local
363 size = (size_t)MINSIZE << getbucketnum(size + sizeof (*ptr)); in libc_realloc()
364 if ((ptr = lmalloc(size)) == NULL) in libc_realloc()
366 ptr->private_size = size; in libc_realloc()
367 new = ptr + 1; in libc_realloc()
369 ptr = (private_header_t *)old - 1; in libc_realloc()
370 if (size >= ptr->private_size) in libc_realloc()
371 size = ptr->private_size; in libc_realloc()
372 (void) memcpy(new, old, size - sizeof (*ptr)); in libc_realloc()
373 lfree(ptr, ptr->private_size); in libc_realloc()
381 private_header_t *ptr; in libc_free() local
384 ptr = (private_header_t *)p - 1; in libc_free()
385 lfree(ptr, ptr->private_size); in libc_free()