| 283 | * information as the first bytes of every allocation. */ |
| 284 | #ifndef HAVE_MALLOC_SIZE |
| 285 | size_t zmalloc_size(void *ptr) { |
| 286 | void *realptr = (char*)ptr-PREFIX_SIZE; |
| 287 | size_t size = *((size_t*)realptr); |
| 288 | return size+PREFIX_SIZE; |
| 289 | } |
| 290 | size_t zmalloc_usable_size(void *ptr) { |
| 291 | return zmalloc_size(ptr)-PREFIX_SIZE; |
| 292 | } |
no outgoing calls
no test coverage detected