vec_free()

Frees memory allocated by vec_malloc, vec_calloc and vec_realloc

  #include <stdlib.h>
  
  void vec_free(void *ptr);    
Parameter

ptr

a pointer to allocated memory

Remarks

The vec_free() function releases a previously allocated memory block, pointed to by ptr, to the heap. The ptr argument should hold an address returned by the memory allocation functions vec_calloc(), vec_malloc(), or vec_realloc(). Once the memory block ptr points to has been released, it is no longer valid. The ptr variable should not be used to reference memory again until it is assigned a value from the memory allocation functions.