Function ndpi_realloc

Function Documentation

void *ndpi_realloc(void *ptr, size_t old_size, size_t new_size)

Reallocate memory using nDPI’s memory allocator. This function can be customized via ndpi_set_realloc() to use a custom allocator.

Parameters:
  • ptr – Pointer to previously allocated memory (or NULL for new allocation)

  • old_size – Current size of the allocated block in bytes

  • new_size – Desired new size in bytes

Returns:

Pointer to reallocated memory, or NULL on failure