struct gmio_memblock gmio_memblock_default()
Returns a memblock created with the function gmio_memblock_default_constructor()
struct gmio_memblock gmio_memblock_realloc(void *ptr, size_t size)
Returns a memblock 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:89
Fundamental global declarations, included by almost all other header/source files.
void(* func_deallocate)(void *ptr)
Optional function that deallocates the memory block beginning at ptr.
Definition: memblock.h:67
#define GMIO_C_LINKAGE_BEGIN
Expands to extern "C" { when building with a C++ compiler.
Definition: global.h:203
struct gmio_memblock(* gmio_memblock_constructor_func_t)()
Typedef for a pointer to a function that creates an allocated memblock.
Definition: memblock.h:99
struct gmio_memblock gmio_memblock_malloc(size_t size)
Returns a memblock 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:205
struct gmio_memblock gmio_memblock_calloc(size_t num, size_t size)
Returns a memblock allocated with standard calloc().
void * ptr
Pointer to the beginning of the memory block.
Definition: memblock.h:60
gmio_memblock_constructor_func_t gmio_memblock_default_constructor()
Returns the currently installed function to construct memblock objects.
size_t size
Size (in bytes) of the memory block.
Definition: memblock.h:63
Basic memory block.
Definition: memblock.h:57
bool gmio_memblock_isnull(const struct gmio_memblock *mblock)
Returns true if mblock is NULL or points to null/void memory.