* 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. */
| 1135 | * them if they are returned. |
| 1136 | */ |
| 1137 | static void * |
| 1138 | extent_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 | |
| 1167 | static void * |
| 1168 | extent_alloc_default_impl(tsdn_t *tsdn, arena_t *arena, void *new_addr, |
no test coverage detected