Lines Matching refs:gm
2633 #define gm (&_gm_)
3095 static void pre_fork(void) { ACQUIRE_LOCK(&(gm)->mutex); }
3096 static void post_fork_parent(void) { RELEASE_LOCK(&(gm)->mutex); }
3097 static void post_fork_child(void) { INITIAL_LOCK(&(gm)->mutex); }
3159 gm->mflags = mparams.default_mflags;
3160 (void)INITIAL_LOCK(&gm->mutex);
3820 ((m == gm)? dlmalloc(b) : mspace_malloc(m, b))
3822 if (m == gm) dlfree(mem); else mspace_free(m,mem);
4594 if (!PREACTION(gm)) {
4602 smallbits = gm->smallmap >> idx;
4607 b = smallbin_at(gm, idx);
4610 unlink_first_small_chunk(gm, b, p, idx);
4611 set_inuse_and_pinuse(gm, p, small_index2size(idx));
4613 check_malloced_chunk(gm, mem, nb);
4617 else if (nb > gm->dvsize) {
4625 b = smallbin_at(gm, i);
4628 unlink_first_small_chunk(gm, b, p, i);
4632 set_inuse_and_pinuse(gm, p, small_index2size(i));
4634 set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
4637 replace_dv(gm, r, rsize);
4640 check_malloced_chunk(gm, mem, nb);
4644 else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) {
4645 check_malloced_chunk(gm, mem, nb);
4654 if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {
4655 check_malloced_chunk(gm, mem, nb);
4660 if (nb <= gm->dvsize) {
4661 size_t rsize = gm->dvsize - nb;
4662 mchunkptr p = gm->dv;
4664 mchunkptr r = gm->dv = chunk_plus_offset(p, nb);
4665 gm->dvsize = rsize;
4667 set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
4670 size_t dvs = gm->dvsize;
4671 gm->dvsize = 0;
4672 gm->dv = 0;
4673 set_inuse_and_pinuse(gm, p, dvs);
4676 check_malloced_chunk(gm, mem, nb);
4680 else if (nb < gm->topsize) { /* Split top */
4681 size_t rsize = gm->topsize -= nb;
4682 mchunkptr p = gm->top;
4683 mchunkptr r = gm->top = chunk_plus_offset(p, nb);
4685 set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
4687 check_top_chunk(gm, gm->top);
4688 check_malloced_chunk(gm, mem, nb);
4692 mem = sys_alloc(gm, nb);
4695 POSTACTION(gm);
4720 #define fm gm
5224 mstate m = gm;
5262 mstate m = gm;
5287 return internal_memalign(gm, alignment, bytes);
5302 mem = internal_memalign(gm, alignment, bytes);
5330 return ialloc(gm, n_elements, &sz, 3, chunks);
5335 return ialloc(gm, n_elements, sizes, 0, chunks);
5339 return internal_bulk_free(gm, array, nelem);
5349 if (!PREACTION(gm)) {
5350 internal_inspect_all(gm, handler, arg);
5351 POSTACTION(gm);
5359 if (!PREACTION(gm)) {
5360 result = sys_trim(gm, pad);
5361 POSTACTION(gm);
5367 return gm->footprint;
5371 return gm->max_footprint;
5375 size_t maf = gm->footprint_limit;
5387 return gm->footprint_limit = result;
5392 return internal_mallinfo(gm);
5398 internal_malloc_stats(gm);