MGE General C Library - Full Internal Documentation  v1.6.8
Library of general C functions.
mgememory.h File Reference

Header file for memory functions. More...

#include <portability.h>
#include <sys/types.h>
Include dependency graph for mgememory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BEGIN_C_DECLS char * mg_realloc (char *mem_ptr, const size_t mem_sz)
 Wrap realloc to include error handling. More...
 

Detailed Description

Header file for memory functions.

All memory manipulation related information.

Author
Copyright (C) 2017-2019, 2021 Mark Grant

Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only

Version
v1.0.6 ==== 03/12/2021

Function Documentation

◆ mg_realloc()

BEGIN_C_DECLS char* mg_realloc ( char *  mem_ptr,
const size_t  mem_sz 
)

Wrap realloc to include error handling.

Also used for a malloc by passing mem_ptr as NULL. On error mge_errno will be set and the old mem_ptr will be unchanged.

Parameters
mem_ptrThe memory area to be re-sized.
mem_szThe new size required.
Returns
the new memory area or NULL on error.