util/mem: cleanup by moving atomic from mem hdr

pull/4806/head
Victor Julien 5 years ago
parent 3b877929e3
commit 415c992909

@ -29,6 +29,7 @@
#include "counters.h"
#include "threads.h"
#include "packet-queue.h"
#include "util-atomic.h"
struct TmSlot_;

@ -30,6 +30,7 @@
#include "util-enum.h"
#include "util-error.h"
#include "util-debug-filters.h"
#include "util-atomic.h"
/**
* \brief ENV vars that can be used to set the properties for the logging module
@ -540,6 +541,7 @@ void SCLogErr(int x, const char *file, const char *func, const int line,
* errors to be fatal errors */
#if !defined(__clang_analyzer__)
#define FatalErrorOnInit(x, ...) do { \
SC_ATOMIC_EXTERN(unsigned int, engine_stage); \
int init_errors_fatal = 0; \
ConfGetBool("engine.init-failure-fatal", &init_errors_fatal); \
if (init_errors_fatal && (SC_ATOMIC_GET(engine_stage) == SURICATA_INIT))\

@ -17,6 +17,9 @@
#include "suricata-common.h"
#include "suricata.h"
#include "util-atomic.h"
SC_ATOMIC_EXTERN(unsigned int, engine_stage);
void *SCMallocFunc(const size_t sz)
{

@ -31,8 +31,6 @@
#ifndef __UTIL_MEM_H__
#define __UTIL_MEM_H__
#include "util-atomic.h"
#if CPPCHECK==1 || defined(__clang_analyzer__)
#define SCMalloc malloc
#define SCCalloc calloc
@ -49,8 +47,6 @@
#include "mm_malloc.h"
#endif
SC_ATOMIC_EXTERN(unsigned int, engine_stage);
void *SCMallocFunc(const size_t sz);
#define SCMalloc(sz) SCMallocFunc((sz))

Loading…
Cancel
Save