Replace alloc function declarations with defines

Replace the GPAC wrappers around the malloc-style functions (gf_malloc,
gf_free, etc.) with defines that use the standard C versions of these
functions so that we can avoid including GPAC's alloc.c
This commit is contained in:
Pranav Rajpal
2021-04-19 21:45:58 -07:00
parent a03f0f3018
commit 0cea6a642e

View File

@@ -687,33 +687,33 @@ u64 gf_memory_size(); /*gets memory allocated in bytes*/
/*! free memory allocated with gpac
\param ptr same as free()
*/
void gf_free(void *ptr);
#define gf_free free
/*! allocates memory, shall be freed using \ref gf_free
\param size same as malloc()
\return adress of allocated block
*/
void* gf_malloc(size_t size);
#define gf_malloc malloc
/*! allocates memory array, shall be freed using \ref gf_free
\param num same as calloc()
\param size_of same as calloc()
\return adress of allocated block
*/
void* gf_calloc(size_t num, size_t size_of);
#define gf_calloc calloc
/*! duplicates string, shall be freed using \ref gf_free
\param str same as strdup()
\return duplicated string
*/
char* gf_strdup(const char *str);
#define gf_strdup strdup
/*! reallocates memory, shall be freed using \ref gf_free
\param ptr same as realloc()
\param size same as realloc()
\return adress of reallocated block
*/
void* gf_realloc(void *ptr, size_t size);
#define gf_realloc realloc
#endif
/*! @} */