asdf/util.h - Common utilities

Common macros and utilities included by every other public header

void asdf_free(void *buf)

Free a buffer that libasdf allocated on the caller’s behalf

Use this for buffers returned by asdf_write_to_mem, asdf_ndarray_read_all, asdf_ndarray_read_tile_ndim and asdf_ndarray_read_tile_2d when they were asked to allocate the destination buffer. Other pointers returned by libasdf have their own destructors and must not be passed here.

Parameters:
  • buf – The buffer to free; passing NULL is a no-op