LIBJXL
Classes | Typedefs
memory_manager.h File Reference

Abstraction functions used by JPEG XL to allocate memory. More...

#include <stddef.h>
Include dependency graph for memory_manager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JxlMemoryManagerStruct
 

Typedefs

typedef void *(* jpegxl_alloc_func) (void *opaque, size_t size)
 
typedef void(* jpegxl_free_func) (void *opaque, void *address)
 
typedef struct JxlMemoryManagerStruct JxlMemoryManager
 

Detailed Description

Abstraction functions used by JPEG XL to allocate memory.

Typedef Documentation

◆ jpegxl_alloc_func

typedef void *(* jpegxl_alloc_func) (void *opaque, size_t size)

Allocating function for a memory region of a given size.

Allocates a contiguous memory region of size size bytes. The returned memory may not be aligned to a specific size or initialized at all.

Parameters
opaquecustom memory manager handle provided by the caller.
sizein bytes of the requested memory region.
Returns
0 if the memory can not be allocated,
pointer to the memory otherwise.

◆ jpegxl_free_func

typedef void(* jpegxl_free_func) (void *opaque, void *address)

Deallocating function pointer type.

This function MUST do nothing if address is 0.

Parameters
opaquecustom memory manager handle provided by the caller.
addressmemory region pointer returned by jpegxl_alloc_func, or 0

◆ JxlMemoryManager

Memory Manager struct. These functions, when provided by the caller, will be used to handle memory allocations.