Lines Matching refs:mem
1338 DLMALLOC_EXPORT void mspace_free(mspace msp, void* mem);
1349 DLMALLOC_EXPORT void* mspace_realloc(mspace msp, void* mem, size_t newsize);
1401 DLMALLOC_EXPORT size_t mspace_usable_size(const void* mem);
2226 #define _mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) argument
2230 #define mem2chunk(mem) (mchunkptr)hwasan_remove_ptr_tag(_mem2chunk(mem)) argument
2233 #define mem2chunk(mem) _mem2chunk(mem) argument
2828 static void do_check_malloced_chunk(mstate m, void* mem, size_t s);
3299 static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { in do_check_malloced_chunk() argument
3300 if (mem != 0) { in do_check_malloced_chunk()
3301 mchunkptr p = mem2chunk(mem); in do_check_malloced_chunk()
3814 #define internal_free(m, mem) mspace_free(m,mem); argument
3819 #define internal_free(m, mem)\ argument
3820 if (m == gm) dlfree(mem); else mspace_free(m,mem);
3823 #define internal_free(m, mem) dlfree(mem) argument
4059 void* mem = mmap_alloc(m, nb); in sys_alloc() local
4060 if (mem != 0) in sys_alloc()
4061 return mem; in sys_alloc()
4585 void* mem; in dlmalloc() local
4602 mem = chunk2mem(p); in dlmalloc()
4603 check_malloced_chunk(gm, mem, nb); in dlmalloc()
4629 mem = chunk2mem(p); in dlmalloc()
4630 check_malloced_chunk(gm, mem, nb); in dlmalloc()
4634 else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { in dlmalloc()
4635 check_malloced_chunk(gm, mem, nb); in dlmalloc()
4644 if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { in dlmalloc()
4645 check_malloced_chunk(gm, mem, nb); in dlmalloc()
4665 mem = chunk2mem(p); in dlmalloc()
4666 check_malloced_chunk(gm, mem, nb); in dlmalloc()
4676 mem = chunk2mem(p); in dlmalloc()
4678 check_malloced_chunk(gm, mem, nb); in dlmalloc()
4682 mem = sys_alloc(gm, nb); in dlmalloc()
4687 return hwasan_tag_memory(mem, bytes); in dlmalloc()
4689 return mem; in dlmalloc()
4698 void dlfree(void* mem) { in dlfree() argument
4705 if (mem != 0) { in dlfree()
4706 mchunkptr p = mem2chunk(mem); in dlfree()
4708 hwasan_untag_memory(mem, chunksize(p)); in dlfree()
4709 mem = hwasan_remove_ptr_tag(mem); in dlfree()
4812 void* mem; in dlcalloc() local
4820 mem = dlmalloc(req); in dlcalloc()
4821 if (mem != 0 && calloc_must_clear(mem2chunk(mem))) in dlcalloc()
4822 memset(mem, 0, req); in dlcalloc()
4823 return mem; in dlcalloc()
4911 void* mem = 0; in internal_memalign() local
4927 mem = internal_malloc(m, req); in internal_memalign()
4928 if (mem != 0) { in internal_memalign()
4929 mchunkptr p = mem2chunk(mem); in internal_memalign()
4931 hwasan_untag_memory(mem, chunksize(p)); in internal_memalign()
4932 mem = hwasan_remove_ptr_tag(mem); in internal_memalign()
4936 if ((((size_t)(mem)) & (alignment - 1)) != 0) { /* misaligned */ in internal_memalign()
4945 char* br = (char*)mem2chunk((size_t)(((size_t)((char*)mem + alignment - in internal_memalign()
4978 mem = chunk2mem(p); in internal_memalign()
4980 assert(((size_t)mem & (alignment - 1)) == 0); in internal_memalign()
4986 mem = hwasan_tag_memory(mem, bytes); in internal_memalign()
4988 return mem; in internal_memalign()
5007 void* mem; /* malloced aggregate space */ in ialloc() local
5053 mem = internal_malloc(m, size - CHUNK_OVERHEAD); in ialloc()
5056 if (mem == 0) in ialloc()
5060 p = mem2chunk(mem); in ialloc()
5066 memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); in ialloc()
5130 void* mem = *a; in internal_bulk_free() local
5131 if (mem != 0) { in internal_bulk_free()
5132 mchunkptr p = mem2chunk(mem); in internal_bulk_free()
5213 void* mem = 0; in dlrealloc() local
5215 mem = dlmalloc(bytes); in dlrealloc()
5246 mem = chunk2mem(newp); in dlrealloc()
5249 mem = internal_malloc(m, bytes); in dlrealloc()
5250 if (mem != 0) { in dlrealloc()
5252 memcpy(mem, oldmem, (oc < bytes)? oc : bytes); in dlrealloc()
5259 return hwasan_tag_memory(mem, bytes); in dlrealloc()
5261 return mem; in dlrealloc()
5266 void* mem = 0; in dlrealloc_in_place() local
5288 mem = oldmem; in dlrealloc_in_place()
5293 return mem; in dlrealloc_in_place()
5304 void* mem = 0; in dlposix_memalign() local
5306 mem = dlmalloc(bytes); in dlposix_memalign()
5315 mem = internal_memalign(gm, alignment, bytes); in dlposix_memalign()
5318 if (mem == 0) in dlposix_memalign()
5321 *pp = mem; in dlposix_memalign()
5419 size_t dlmalloc_usable_size(void* mem) { in dlmalloc_usable_size() argument
5420 if (mem != 0) { in dlmalloc_usable_size()
5421 mchunkptr p = mem2chunk(mem); in dlmalloc_usable_size()
5542 void* mem; in mspace_malloc() local
5559 mem = chunk2mem(p); in mspace_malloc()
5560 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5586 mem = chunk2mem(p); in mspace_malloc()
5587 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5591 else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { in mspace_malloc()
5592 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5601 if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { in mspace_malloc()
5602 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5622 mem = chunk2mem(p); in mspace_malloc()
5623 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5633 mem = chunk2mem(p); in mspace_malloc()
5635 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5639 mem = sys_alloc(ms, nb); in mspace_malloc()
5643 return mem; in mspace_malloc()
5649 void mspace_free(mspace msp, void* mem) { in mspace_free() argument
5650 if (mem != 0) { in mspace_free()
5651 mchunkptr p = mem2chunk(mem); in mspace_free()
5751 void* mem; in mspace_calloc() local
5764 mem = internal_malloc(ms, req); in mspace_calloc()
5765 if (mem != 0 && calloc_must_clear(mem2chunk(mem))) in mspace_calloc()
5766 memset(mem, 0, req); in mspace_calloc()
5767 return mem; in mspace_calloc()
5771 void* mem = 0; in mspace_realloc() local
5773 mem = mspace_malloc(msp, bytes); in mspace_realloc()
5800 mem = chunk2mem(newp); in mspace_realloc()
5803 mem = mspace_malloc(m, bytes); in mspace_realloc()
5804 if (mem != 0) { in mspace_realloc()
5806 memcpy(mem, oldmem, (oc < bytes)? oc : bytes); in mspace_realloc()
5812 return mem; in mspace_realloc()
5816 void* mem = 0; in mspace_realloc_in_place() local
5839 mem = oldmem; in mspace_realloc_in_place()
5844 return mem; in mspace_realloc_in_place()
5995 size_t mspace_usable_size(const void* mem) { in mspace_usable_size() argument
5996 if (mem != 0) { in mspace_usable_size()
5997 mchunkptr p = mem2chunk(mem); in mspace_usable_size()