MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / arena_palloc

Function arena_palloc

deps/memkind/src/jemalloc/src/arena.c:1562–1580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1560}
1561
1562void *
1563arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
1564 bool zero, tcache_t *tcache) {
1565 void *ret;
1566
1567 if (usize <= SMALL_MAXCLASS && (alignment < PAGE || (alignment == PAGE
1568 && (usize & PAGE_MASK) == 0))) {
1569 /* Small; alignment doesn't require special slab placement. */
1570 ret = arena_malloc(tsdn, arena, usize, sz_size2index(usize),
1571 zero, tcache, true);
1572 } else {
1573 if (likely(alignment <= CACHELINE)) {
1574 ret = large_malloc(tsdn, arena, usize, zero);
1575 } else {
1576 ret = large_palloc(tsdn, arena, usize, alignment, zero);
1577 }
1578 }
1579 return ret;
1580}
1581
1582void
1583arena_prof_promote(tsdn_t *tsdn, const void *ptr, size_t usize) {

Callers 1

ipallocztmFunction · 0.50

Calls 4

large_mallocFunction · 0.70
large_pallocFunction · 0.70
arena_mallocFunction · 0.50
sz_size2indexFunction · 0.50

Tested by

no test coverage detected