Go to the documentation of this file.
31 #ifndef SURICATA_UTIL_MEM_H
32 #define SURICATA_UTIL_MEM_H
34 #if CPPCHECK==1 || defined(__clang_analyzer__)
35 #define SCMalloc malloc
36 #define SCCalloc calloc
37 #define SCRealloc realloc
39 #define SCStrdup strdup
40 #define SCStrndup strndup
41 #define SCMallocAligned _mm_malloc
42 #define SCFreeAligned _mm_free
47 #define SCMalloc(sz) SCMallocFunc((sz))
50 #define SCRealloc(ptr, sz) SCReallocFunc((ptr), (sz))
53 #define SCCalloc(nm, sz) SCCallocFunc((nm), (sz))
56 #define SCStrdup(s) SCStrdupFunc((s))
59 #define SCStrndup(s, n) SCStrndupFunc((s), (n))
61 #define SCFree(p) free((p))
68 #define SCMallocAligned(size, align) SCMallocAlignedFunc((size), (align))
77 #define SCFreeAligned(p) SCFreeAlignedFunc((p))
char * SCStrndupFunc(const char *s, size_t n)
char * SCStrdupFunc(const char *s)
void * SCCallocFunc(const size_t nm, const size_t sz)
void * SCReallocFunc(void *ptr, const size_t size)
void SCFreeAlignedFunc(void *ptr)
Free aligned memory.
void * SCMallocFunc(const size_t sz)
void * SCMallocAlignedFunc(const size_t size, const size_t align)
wrapper for allocing aligned mem