| 219 | } |
| 220 | |
| 221 | int |
| 222 | rte_malloc_validate(const void *ptr, size_t *size) |
| 223 | { |
| 224 | const struct malloc_elem *elem = malloc_elem_from_data(ptr); |
| 225 | if (!malloc_elem_cookies_ok(elem)) |
| 226 | return -1; |
| 227 | if (size != NULL) |
| 228 | *size = elem->size - elem->pad - MALLOC_ELEM_OVERHEAD; |
| 229 | return 0; |
| 230 | } |
| 231 | |
| 232 | /* |
| 233 | * Function to retrieve data for heap on given socket |