| 281 | #endif |
| 282 | |
| 283 | void zfree(void *ptr) { |
| 284 | #ifndef HAVE_MALLOC_SIZE |
| 285 | void *realptr; |
| 286 | size_t oldsize; |
| 287 | #endif |
| 288 | |
| 289 | if (ptr == NULL) return; |
| 290 | #ifdef HAVE_MALLOC_SIZE |
| 291 | update_zmalloc_stat_free(zmalloc_size(ptr)); |
| 292 | free(ptr); |
| 293 | #else |
| 294 | realptr = (char*)ptr-PREFIX_SIZE; |
| 295 | oldsize = *((size_t*)realptr); |
| 296 | update_zmalloc_stat_free(oldsize+PREFIX_SIZE); |
| 297 | free(realptr); |
| 298 | #endif |
| 299 | } |
| 300 | |
| 301 | /* Similar to zfree, '*usable' is set to the usable size being freed. */ |
| 302 | void zfree_usable(void *ptr, size_t *usable) { |
no test coverage detected