| 122 | } |
| 123 | |
| 124 | static void |
| 125 | extent_destroy_hook(extent_hooks_t *extent_hooks, void *addr, size_t size, |
| 126 | bool committed, unsigned arena_ind) { |
| 127 | TRACE_HOOK("%s(extent_hooks=%p, addr=%p, size=%zu, committed=%s, " |
| 128 | "arena_ind=%u)\n", __func__, extent_hooks, addr, size, committed ? |
| 129 | "true" : "false", arena_ind); |
| 130 | assert_ptr_eq(extent_hooks, &hooks, |
| 131 | "extent_hooks should be same as pointer used to set hooks"); |
| 132 | assert_ptr_eq(extent_hooks->destroy, extent_destroy_hook, |
| 133 | "Wrong hook function"); |
| 134 | called_destroy = true; |
| 135 | if (!try_destroy) { |
| 136 | return; |
| 137 | } |
| 138 | default_hooks->destroy(default_hooks, addr, size, committed, 0); |
| 139 | did_destroy = true; |
| 140 | } |
| 141 | |
| 142 | static bool |
| 143 | extent_commit_hook(extent_hooks_t *extent_hooks, void *addr, size_t size, |