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

Function extent_alloc_core

app/redis-6.2.6/deps/jemalloc/src/extent.c:1137–1165  ·  view source on GitHub ↗

* If the caller specifies (!*zero), it is still possible to receive zeroed * memory, in which case *zero is toggled to true. arena_extent_alloc() takes * advantage of this to avoid demanding zeroed extents, but taking advantage of * them if they are returned. */

Source from the content-addressed store, hash-verified

1135 * them if they are returned.
1136 */
1137static void *
1138extent_alloc_core(tsdn_t *tsdn, arena_t *arena, void *new_addr, size_t size,
1139 size_t alignment, bool *zero, bool *commit, dss_prec_t dss_prec) {
1140 void *ret;
1141
1142 assert(size != 0);
1143 assert(alignment != 0);
1144
1145 /* "primary" dss. */
1146 if (have_dss && dss_prec == dss_prec_primary && (ret =
1147 extent_alloc_dss(tsdn, arena, new_addr, size, alignment, zero,
1148 commit)) != NULL) {
1149 return ret;
1150 }
1151 /* mmap. */
1152 if ((ret = extent_alloc_mmap(new_addr, size, alignment, zero, commit))
1153 != NULL) {
1154 return ret;
1155 }
1156 /* "secondary" dss. */
1157 if (have_dss && dss_prec == dss_prec_secondary && (ret =
1158 extent_alloc_dss(tsdn, arena, new_addr, size, alignment, zero,
1159 commit)) != NULL) {
1160 return ret;
1161 }
1162
1163 /* All strategies for allocation failed. */
1164 return NULL;
1165}
1166
1167static void *
1168extent_alloc_default_impl(tsdn_t *tsdn, arena_t *arena, void *new_addr,

Callers 1

Calls 2

extent_alloc_dssFunction · 0.85
extent_alloc_mmapFunction · 0.85

Tested by

no test coverage detected