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

Function extent_lock_from_addr

deps/jemalloc/src/extent.c:162–177  ·  view source on GitHub ↗

* Returns a pool-locked extent_t * if there's one associated with the given * address, and NULL otherwise. */

Source from the content-addressed store, hash-verified

160 * address, and NULL otherwise.
161 */
162static extent_t *
163extent_lock_from_addr(tsdn_t *tsdn, rtree_ctx_t *rtree_ctx, void *addr,
164 bool inactive_only) {
165 extent_t *ret = NULL;
166 rtree_leaf_elm_t *elm = rtree_leaf_elm_lookup(tsdn, &extents_rtree,
167 rtree_ctx, (uintptr_t)addr, false, false);
168 if (elm == NULL) {
169 return NULL;
170 }
171 lock_result_t lock_result;
172 do {
173 lock_result = extent_rtree_leaf_elm_try_lock(tsdn, elm, &ret,
174 inactive_only);
175 } while (lock_result == lock_result_failure);
176 return ret;
177}
178
179extent_t *
180extent_alloc(tsdn_t *tsdn, arena_t *arena) {

Callers 3

extent_recycle_extractFunction · 0.70
extent_recycle_splitFunction · 0.70
extent_try_coalesce_implFunction · 0.70

Calls 1

Tested by

no test coverage detected