MCPcopy Create free account
hub / github.com/F-Stack/f-stack / imalloc_no_sample

Function imalloc_no_sample

app/redis-6.2.6/deps/jemalloc/src/jemalloc.c:1671–1711  ·  view source on GitHub ↗

ind is ignored if dopts->alignment > 0. */

Source from the content-addressed store, hash-verified

1669
1670/* ind is ignored if dopts->alignment > 0. */
1671JEMALLOC_ALWAYS_INLINE void *
1672imalloc_no_sample(static_opts_t *sopts, dynamic_opts_t *dopts, tsd_t *tsd,
1673 size_t size, size_t usize, szind_t ind) {
1674 tcache_t *tcache;
1675 arena_t *arena;
1676
1677 /* Fill in the tcache. */
1678 if (dopts->tcache_ind == TCACHE_IND_AUTOMATIC) {
1679 if (likely(!sopts->slow)) {
1680 /* Getting tcache ptr unconditionally. */
1681 tcache = tsd_tcachep_get(tsd);
1682 assert(tcache == tcache_get(tsd));
1683 } else {
1684 tcache = tcache_get(tsd);
1685 }
1686 } else if (dopts->tcache_ind == TCACHE_IND_NONE) {
1687 tcache = NULL;
1688 } else {
1689 tcache = tcaches_get(tsd, dopts->tcache_ind);
1690 }
1691
1692 /* Fill in the arena. */
1693 if (dopts->arena_ind == ARENA_IND_AUTOMATIC) {
1694 /*
1695 * In case of automatic arena management, we defer arena
1696 * computation until as late as we can, hoping to fill the
1697 * allocation out of the tcache.
1698 */
1699 arena = NULL;
1700 } else {
1701 arena = arena_get(tsd_tsdn(tsd), dopts->arena_ind, true);
1702 }
1703
1704 if (unlikely(dopts->alignment != 0)) {
1705 return ipalloct(tsd_tsdn(tsd), usize, dopts->alignment,
1706 dopts->zero, tcache, arena);
1707 }
1708
1709 return iallocztm(tsd_tsdn(tsd), size, ind, dopts->zero, tcache, false,
1710 arena, sopts->slow);
1711}
1712
1713JEMALLOC_ALWAYS_INLINE void *
1714imalloc_sample(static_opts_t *sopts, dynamic_opts_t *dopts, tsd_t *tsd,

Callers 2

imalloc_sampleFunction · 0.85
imalloc_bodyFunction · 0.85

Calls 6

tcache_getFunction · 0.85
tcaches_getFunction · 0.85
arena_getFunction · 0.85
tsd_tsdnFunction · 0.85
ipalloctFunction · 0.85
iallocztmFunction · 0.85

Tested by

no test coverage detected