| 130 | */ |
| 131 | |
| 132 | static size_t |
| 133 | zone_size(malloc_zone_t *zone, const void *ptr) { |
| 134 | /* |
| 135 | * There appear to be places within Darwin (such as setenv(3)) that |
| 136 | * cause calls to this function with pointers that *no* zone owns. If |
| 137 | * we knew that all pointers were owned by *some* zone, we could split |
| 138 | * our zone into two parts, and use one as the default allocator and |
| 139 | * the other as the default deallocator/reallocator. Since that will |
| 140 | * not work in practice, we must check all pointers to assure that they |
| 141 | * reside within a mapped extent before determining size. |
| 142 | */ |
| 143 | return ivsalloc(tsdn_fetch(), ptr); |
| 144 | } |
| 145 | |
| 146 | static void * |
| 147 | zone_malloc(malloc_zone_t *zone, size_t size) { |
nothing calls this directly
no test coverage detected