23 #ifndef GMIO_MEMBLOCK_H
24 #define GMIO_MEMBLOCK_H
struct gmio_memblock gmio_memblock_default()
Returns a gmio_memblock object created using the function gmio_memblock_default_constructor() ...
struct gmio_memblock gmio_memblock_realloc(void *ptr, size_t size)
Returns a gmio_memblock object allocated with standard realloc()
#define GMIO_API
Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively compiling/using the DLL...
Definition: global.h:76
Fundamental global declarations, included by almost all other header/source files.
void(* func_deallocate)(void *ptr)
Optional pointer on a function that deallocates the memory block beginning at ptr.
Definition: memblock.h:58
#define GMIO_C_LINKAGE_BEGIN
Expands to extern "C" { when building with a C++ compiler.
Definition: global.h:181
struct gmio_memblock(* gmio_memblock_constructor_func_t)()
Typedef for a pointer to a function that creates an allocated mblock.
Definition: memblock.h:99
struct gmio_memblock gmio_memblock_malloc(size_t size)
Returns a gmio_memblock object allocated with standard malloc()
void gmio_memblock_deallocate(struct gmio_memblock *mblock)
Safe and convenient call to gmio_memblock::func_deallocate()
void gmio_memblock_set_default_constructor(gmio_memblock_constructor_func_t ctor)
Installs a global function to construct gmio_memblock objects.
#define GMIO_C_LINKAGE_END
Expands to } when building with a C++ compiler.
Definition: global.h:183
struct gmio_memblock gmio_memblock_calloc(size_t num, size_t size)
Returns a gmio_memblock object allocated with standard calloc()
void * ptr
Pointer to the beginning of the memory block.
Definition: memblock.h:48
gmio_memblock_constructor_func_t gmio_memblock_default_constructor()
Returns the currently installed function to construct gmio_memblock objects.
size_t size
Size (in bytes) of the memory block.
Definition: memblock.h:51
Basic memory block.
Definition: memblock.h:45
bool gmio_memblock_isnull(const struct gmio_memblock *mblock)
Returns true if mblock is NULL or points to null/void memory.