util-mem.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "util-atomic.h"
#include "util-debug.h"
Include dependency graph for util-mem.c:

Go to the source code of this file.


 SC_ATOMIC_EXTERN (unsigned int, engine_stage)
void * SCMallocFunc (const size_t sz)
void * SCReallocFunc (void *ptr, const size_t size)
void * SCCallocFunc (const size_t nm, const size_t sz)
char * SCStrdupFunc (const char *s)
char * SCStrndupFunc (const char *s, size_t n)
void * SCMallocAlignedFunc (const size_t size, const size_t align)
 wrapper for allocing aligned mem More...
void SCFreeAlignedFunc (void *ptr)
 Free aligned memory. More...

Function Documentation


SC_ATOMIC_EXTERN ( unsigned int  ,

◆ SCCallocFunc()

void* SCCallocFunc ( const size_t  nm,
const size_t  sz 

◆ SCFreeAlignedFunc()

void SCFreeAlignedFunc ( void *  ptr)

Free aligned memory.

Not needed for mem alloc'd by posix_memalign, but for possible future use of _mm_malloc needing _mm_free.

Definition at line 133 of file util-mem.c.

◆ SCMallocAlignedFunc()

void* SCMallocAlignedFunc ( const size_t  size,
const size_t  align 

wrapper for allocing aligned mem


Definition at line 104 of file util-mem.c.

References FatalError, SC_ATOMIC_GET, SC_ERR_FATAL, SC_ERR_MEM_ALLOC, SCLogError, MacSet_::size, SURICATA_INIT, and unlikely.

◆ SCMallocFunc()

void* SCMallocFunc ( const size_t  sz)

◆ SCReallocFunc()

void* SCReallocFunc ( void *  ptr,
const size_t  size 

◆ SCStrdupFunc()

char* SCStrdupFunc ( const char *  s)

◆ SCStrndupFunc()

char* SCStrndupFunc ( const char *  s,
size_t  n 

Definition at line 83 of file util-mem.c.

References FatalError, likely, SC_ATOMIC_GET, SC_ERR_FATAL, SC_ERR_MEM_ALLOC, SCLogError, strlcpy(), SURICATA_INIT, and unlikely.

Here is the call graph for this function: