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

Function arena_palloc

deps/jemalloc/src/arena.c:1531–1550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1529}
1530
1531void *
1532arena_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
1533 bool zero, tcache_t *tcache) {
1534 void *ret;
1535
1536 if (usize <= SC_SMALL_MAXCLASS
1537 && (alignment < PAGE
1538 || (alignment == PAGE && (usize & PAGE_MASK) == 0))) {
1539 /* Small; alignment doesn't require special slab placement. */
1540 ret = arena_malloc(tsdn, arena, usize, sz_size2index(usize),
1541 zero, tcache, true);
1542 } else {
1543 if (likely(alignment <= CACHELINE)) {
1544 ret = large_malloc(tsdn, arena, usize, zero);
1545 } else {
1546 ret = large_palloc(tsdn, arena, usize, alignment, zero);
1547 }
1548 }
1549 return ret;
1550}
1551
1552void
1553arena_prof_promote(tsdn_t *tsdn, 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