Lines Matching refs:ms

5492   mstate ms = (mstate)msp;  in mspace_track_large_chunks()  local
5493 if (!PREACTION(ms)) { in mspace_track_large_chunks()
5494 if (!use_mmap(ms)) { in mspace_track_large_chunks()
5498 enable_mmap(ms); in mspace_track_large_chunks()
5500 disable_mmap(ms); in mspace_track_large_chunks()
5502 POSTACTION(ms); in mspace_track_large_chunks()
5509 mstate ms = (mstate)msp; in destroy_mspace() local
5510 if (ok_magic(ms)) { in destroy_mspace()
5511 msegmentptr sp = &ms->seg; in destroy_mspace()
5512 (void)DESTROY_LOCK(&ms->mutex); /* destroy before unmapped */ in destroy_mspace()
5525 USAGE_ERROR_ACTION(ms,ms); in destroy_mspace()
5536 mstate ms = (mstate)msp; in mspace_malloc() local
5537 if (!ok_magic(ms)) { in mspace_malloc()
5538 USAGE_ERROR_ACTION(ms,ms); in mspace_malloc()
5541 if (!PREACTION(ms)) { in mspace_malloc()
5549 smallbits = ms->smallmap >> idx; in mspace_malloc()
5554 b = smallbin_at(ms, idx); in mspace_malloc()
5557 unlink_first_small_chunk(ms, b, p, idx); in mspace_malloc()
5558 set_inuse_and_pinuse(ms, p, small_index2size(idx)); in mspace_malloc()
5560 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5564 else if (nb > ms->dvsize) { in mspace_malloc()
5572 b = smallbin_at(ms, i); in mspace_malloc()
5575 unlink_first_small_chunk(ms, b, p, i); in mspace_malloc()
5579 set_inuse_and_pinuse(ms, p, small_index2size(i)); in mspace_malloc()
5581 set_size_and_pinuse_of_inuse_chunk(ms, p, nb); in mspace_malloc()
5584 replace_dv(ms, r, rsize); 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()
5607 if (nb <= ms->dvsize) { in mspace_malloc()
5608 size_t rsize = ms->dvsize - nb; in mspace_malloc()
5609 mchunkptr p = ms->dv; in mspace_malloc()
5611 mchunkptr r = ms->dv = chunk_plus_offset(p, nb); in mspace_malloc()
5612 ms->dvsize = rsize; in mspace_malloc()
5614 set_size_and_pinuse_of_inuse_chunk(ms, p, nb); in mspace_malloc()
5617 size_t dvs = ms->dvsize; in mspace_malloc()
5618 ms->dvsize = 0; in mspace_malloc()
5619 ms->dv = 0; in mspace_malloc()
5620 set_inuse_and_pinuse(ms, p, dvs); in mspace_malloc()
5623 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5627 else if (nb < ms->topsize) { /* Split top */ in mspace_malloc()
5628 size_t rsize = ms->topsize -= nb; in mspace_malloc()
5629 mchunkptr p = ms->top; in mspace_malloc()
5630 mchunkptr r = ms->top = chunk_plus_offset(p, nb); in mspace_malloc()
5632 set_size_and_pinuse_of_inuse_chunk(ms, p, nb); in mspace_malloc()
5634 check_top_chunk(ms, ms->top); in mspace_malloc()
5635 check_malloced_chunk(ms, mem, nb); in mspace_malloc()
5639 mem = sys_alloc(ms, nb); in mspace_malloc()
5642 POSTACTION(ms); in mspace_malloc()
5753 mstate ms = (mstate)msp; in mspace_calloc() local
5754 if (!ok_magic(ms)) { in mspace_calloc()
5755 USAGE_ERROR_ACTION(ms,ms); in mspace_calloc()
5764 mem = internal_malloc(ms, req); in mspace_calloc()
5848 mstate ms = (mstate)msp; in mspace_memalign() local
5849 if (!ok_magic(ms)) { in mspace_memalign()
5850 USAGE_ERROR_ACTION(ms,ms); in mspace_memalign()
5855 return internal_memalign(ms, alignment, bytes); in mspace_memalign()
5861 mstate ms = (mstate)msp; in mspace_independent_calloc() local
5862 if (!ok_magic(ms)) { in mspace_independent_calloc()
5863 USAGE_ERROR_ACTION(ms,ms); in mspace_independent_calloc()
5866 return ialloc(ms, n_elements, &sz, 3, chunks); in mspace_independent_calloc()
5871 mstate ms = (mstate)msp; in mspace_independent_comalloc() local
5872 if (!ok_magic(ms)) { in mspace_independent_comalloc()
5873 USAGE_ERROR_ACTION(ms,ms); in mspace_independent_comalloc()
5876 return ialloc(ms, n_elements, sizes, 0, chunks); in mspace_independent_comalloc()
5890 mstate ms = (mstate)msp; in mspace_inspect_all() local
5891 if (ok_magic(ms)) { in mspace_inspect_all()
5892 if (!PREACTION(ms)) { in mspace_inspect_all()
5893 internal_inspect_all(ms, handler, arg); in mspace_inspect_all()
5894 POSTACTION(ms); in mspace_inspect_all()
5898 USAGE_ERROR_ACTION(ms,ms); in mspace_inspect_all()
5905 mstate ms = (mstate)msp; in mspace_trim() local
5906 if (ok_magic(ms)) { in mspace_trim()
5907 if (!PREACTION(ms)) { in mspace_trim()
5908 result = sys_trim(ms, pad); in mspace_trim()
5909 POSTACTION(ms); in mspace_trim()
5913 USAGE_ERROR_ACTION(ms,ms); in mspace_trim()
5920 mstate ms = (mstate)msp; in mspace_malloc_stats() local
5921 if (ok_magic(ms)) { in mspace_malloc_stats()
5922 internal_malloc_stats(ms); in mspace_malloc_stats()
5925 USAGE_ERROR_ACTION(ms,ms); in mspace_malloc_stats()
5932 mstate ms = (mstate)msp; in mspace_footprint() local
5933 if (ok_magic(ms)) { in mspace_footprint()
5934 result = ms->footprint; in mspace_footprint()
5937 USAGE_ERROR_ACTION(ms,ms); in mspace_footprint()
5944 mstate ms = (mstate)msp; in mspace_max_footprint() local
5945 if (ok_magic(ms)) { in mspace_max_footprint()
5946 result = ms->max_footprint; in mspace_max_footprint()
5949 USAGE_ERROR_ACTION(ms,ms); in mspace_max_footprint()
5956 mstate ms = (mstate)msp; in mspace_footprint_limit() local
5957 if (ok_magic(ms)) { in mspace_footprint_limit()
5958 size_t maf = ms->footprint_limit; in mspace_footprint_limit()
5962 USAGE_ERROR_ACTION(ms,ms); in mspace_footprint_limit()
5969 mstate ms = (mstate)msp; in mspace_set_footprint_limit() local
5970 if (ok_magic(ms)) { in mspace_set_footprint_limit()
5977 ms->footprint_limit = result; in mspace_set_footprint_limit()
5980 USAGE_ERROR_ACTION(ms,ms); in mspace_set_footprint_limit()
5987 mstate ms = (mstate)msp; in mspace_mallinfo() local
5988 if (!ok_magic(ms)) { in mspace_mallinfo()
5989 USAGE_ERROR_ACTION(ms,ms); in mspace_mallinfo()
5991 return internal_mallinfo(ms); in mspace_mallinfo()