png_set_mem_fn

Name

png_set_mem_fn -- install custom memory allocation functions

Synopsis

#include <png.h>

void png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn);

Description

This interface shall install custom memory allocation functions.

The parameter png_ptr shall specify the PNG file.

The parameter mem_ptr shall specify a struct provided by the user for memory functions.

The parameter malloc_fn shall specify the function used to allocate memory. If the value of this parameter is NULL, then the capability to allocate memory with the libpng ABI shall be disabled.

The parameter free_fn shall specify the function used to free memory. If the value of this parameter is NULL, then the capability to free memory with the libpng ABI shall be disabled.