libgpac
Documentation of the core library of GPAC
Loading...
Searching...
No Matches
alloc.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <config.h>
#include <base/commandlineflags.h>
#include <google/malloc_extension.h>
#include <stdlib.h>
#include <assert.h>
#include <gpac/configuration.h>
#include <gpac/setup.h>
#include <gpac/tools.h>
+ Include dependency graph for alloc.c:

Macros

#define STD_MALLOC   0
 
#define GOOGLE_MALLOC   1
 
#define INTEL_MALLOC   2
 
#define DL_MALLOC   3
 
#define USE_MALLOC   STD_MALLOC
 
#define MALLOC   malloc
 
#define CALLOC   calloc
 
#define REALLOC   realloc
 
#define FREE   free
 
#define STRDUP(a)   return strdup(a);
 
#define CDECL   extern "C"
 
#define CDECL
 
#define MALLOC   scalable_malloc
 
#define CALLOC   scalable_calloc
 
#define REALLOC   scalable_realloc
 
#define FREE   scalable_free
 
#define STRDUP(_a)   if (_a) { unsigned int len = strlen(_a)+1; char *ptr = (char *) scalable_malloc(len); strcpy(ptr, _a); return ptr; } else { return NULL; }
 
#define MALLOC   dlmalloc
 
#define CALLOC   dlcalloc
 
#define REALLOC   dlrealloc
 
#define FREE   dlfree
 
#define STRDUP(_a)   if (_a) { unsigned int len = strlen(_a)+1; char *ptr = (char *) dlmalloc(len); strcpy(ptr, _a); return ptr; } else { return NULL; }
 
#define MALLOC   malloc
 
#define CALLOC   calloc
 
#define REALLOC   realloc
 
#define FREE   free
 
#define STRDUP(a)   return strdup(a);
 

Functions

CDECL void * scalable_malloc (size_t size)
 
CDECL void * scalable_realloc (void *ptr, size_t size)
 
CDECL void * scalable_calloc (size_t num, size_t size)
 
CDECL void scalable_free (void *ptr)
 
CDECL void * dlmalloc (size_t size)
 
CDECL void * dlrealloc (void *ptr, size_t size)
 
CDECL void * dlcalloc (size_t num, size_t size)
 
CDECL void dlfree (void *ptr)
 
GF_EXPORT void * gf_malloc (size_t size)
 
GF_EXPORT void * gf_calloc (size_t num, size_t size_of)
 
GF_EXPORT void * gf_realloc (void *ptr, size_t size)
 
GF_EXPORT void gf_free (void *ptr)
 
GF_EXPORT char * gf_strdup (const char *str)
 
GF_EXPORT size_t gf_strlcpy (char *dst, const char *src, size_t dsize)
 

Macro Definition Documentation

◆ STD_MALLOC

#define STD_MALLOC   0

◆ GOOGLE_MALLOC

#define GOOGLE_MALLOC   1

◆ INTEL_MALLOC

#define INTEL_MALLOC   2

◆ DL_MALLOC

#define DL_MALLOC   3

◆ USE_MALLOC

#define USE_MALLOC   STD_MALLOC

◆ MALLOC [1/4]

#define MALLOC   malloc

◆ CALLOC [1/4]

#define CALLOC   calloc

◆ REALLOC [1/4]

#define REALLOC   realloc

◆ FREE [1/4]

#define FREE   free

◆ STRDUP [1/4]

#define STRDUP (   a)    return strdup(a);

◆ CDECL [1/2]

#define CDECL   extern "C"

◆ CDECL [2/2]

#define CDECL

◆ MALLOC [2/4]

#define MALLOC   scalable_malloc

◆ CALLOC [2/4]

#define CALLOC   scalable_calloc

◆ REALLOC [2/4]

#define REALLOC   scalable_realloc

◆ FREE [2/4]

#define FREE   scalable_free

◆ STRDUP [2/4]

#define STRDUP (   _a)    if (_a) { unsigned int len = strlen(_a)+1; char *ptr = (char *) scalable_malloc(len); strcpy(ptr, _a); return ptr; } else { return NULL; }

◆ MALLOC [3/4]

#define MALLOC   dlmalloc

◆ CALLOC [3/4]

#define CALLOC   dlcalloc

◆ REALLOC [3/4]

#define REALLOC   dlrealloc

◆ FREE [3/4]

#define FREE   dlfree

◆ STRDUP [3/4]

#define STRDUP (   _a)    if (_a) { unsigned int len = strlen(_a)+1; char *ptr = (char *) dlmalloc(len); strcpy(ptr, _a); return ptr; } else { return NULL; }

◆ MALLOC [4/4]

#define MALLOC   malloc

◆ CALLOC [4/4]

#define CALLOC   calloc

◆ REALLOC [4/4]

#define REALLOC   realloc

◆ FREE [4/4]

#define FREE   free

◆ STRDUP [4/4]

#define STRDUP (   a)    return strdup(a);

Function Documentation

◆ scalable_malloc()

CDECL void * scalable_malloc ( size_t  size)

◆ scalable_realloc()

CDECL void * scalable_realloc ( void *  ptr,
size_t  size 
)

◆ scalable_calloc()

CDECL void * scalable_calloc ( size_t  num,
size_t  size 
)

◆ scalable_free()

CDECL void scalable_free ( void *  ptr)

◆ dlmalloc()

void * dlmalloc ( size_t  size)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dlrealloc()

void * dlrealloc ( void *  ptr,
size_t  size 
)
+ Here is the call graph for this function:

◆ dlcalloc()

void * dlcalloc ( size_t  num,
size_t  size 
)
+ Here is the call graph for this function:

◆ dlfree()

void dlfree ( void *  ptr)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_strlcpy()

GF_EXPORT size_t gf_strlcpy ( char *  dst,
const char *  src,
size_t  dsize 
)

copy source string to destination, ensuring 0-terminated string result

Parameters
dstdestination buffer
srcsource buffer
dsizesize of destination buffer
Returns
same as strlcpy
+ Here is the caller graph for this function: