| 260 | do_arena_destroy(arena_ind_another); |
| 261 | } |
| 262 | TEST_END |
| 263 | |
| 264 | /* |
| 265 | * Actually unmap extents, regardless of opt_retain, so that attempts to access |
| 266 | * a destroyed arena's memory will segfault. |
| 267 | */ |
| 268 | static bool |
| 269 | extent_dalloc_unmap(extent_hooks_t *extent_hooks, void *addr, size_t size, |
| 270 | bool committed, unsigned arena_ind) { |
| 271 | TRACE_HOOK("%s(extent_hooks=%p, addr=%p, size=%zu, committed=%s, " |
| 272 | "arena_ind=%u)\n", __func__, extent_hooks, addr, size, committed ? |
| 273 | "true" : "false", arena_ind); |
| 274 | assert_ptr_eq(extent_hooks, &hooks, |
| 275 | "extent_hooks should be same as pointer used to set hooks"); |
| 276 | assert_ptr_eq(extent_hooks->dalloc, extent_dalloc_unmap, |
| 277 | "Wrong hook function"); |
| 278 | called_dalloc = true; |
| 279 | if (!try_dalloc) { |
| 280 | return true; |
| 281 | } |
| 282 | did_dalloc = true; |
| 283 | if (!maps_coalesce && opt_retain) { |
| 284 | return true; |
| 285 | } |
| 286 | pages_unmap(addr, size); |
| 287 | return false; |
| 288 | } |
| 289 | |
| 290 | static extent_hooks_t hooks_orig; |
| 291 |
nothing calls this directly
no test coverage detected