MCPcopy Create free account
hub / github.com/F-Stack/f-stack / malloc_orDie

Function malloc_orDie

freebsd/contrib/zstd/examples/common.h:162–169  ·  view source on GitHub ↗

! malloc_orDie() : * Allocate memory. * * @return If successful this function returns a pointer to allo- * cated memory. If there is an error, this function will send that * error to stderr and exit. */

Source from the content-addressed store, hash-verified

160 * error to stderr and exit.
161 */
162static void* malloc_orDie(size_t size)
163{
164 void* const buff = malloc(size);
165 if (buff) return buff;
166 /* error */
167 perror("malloc");
168 exit(ERROR_malloc);
169}
170
171/*! loadFile_orDie() :
172 * load file into buffer (memory).

Callers 15

decompressFunction · 0.85
createResources_orDieFunction · 0.85
decompressFunction · 0.85
compressFile_orDieFunction · 0.85
createOutFilename_orDieFunction · 0.85
mainFunction · 0.85
compress_orDieFunction · 0.85
createOutFilename_orDieFunction · 0.85
compressFile_orDieFunction · 0.85
createOutFilename_orDieFunction · 0.85
createResources_orDieFunction · 0.85
mainFunction · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected