| 271 | * information as the first bytes of every allocation. */ |
| 272 | #ifndef HAVE_MALLOC_SIZE |
| 273 | size_t zmalloc_size(void *ptr) { |
| 274 | void *realptr = (char*)ptr-PREFIX_SIZE; |
| 275 | size_t size = *((size_t*)realptr); |
| 276 | return size+PREFIX_SIZE; |
| 277 | } |
| 278 | size_t zmalloc_usable_size(void *ptr) { |
| 279 | return zmalloc_size(ptr)-PREFIX_SIZE; |
| 280 | } |
no outgoing calls
no test coverage detected