Introduce utility flow macros to help referencing/dereferencing flows.

pull/103/merge
Anoop Saldanha 13 years ago committed by Victor Julien
parent 4d501778e9
commit 88e89d6302

@ -127,6 +127,16 @@
#define FLOW_CHECK_MEMCAP(size) \
((((uint64_t)SC_ATOMIC_GET(flow_memuse) + (uint64_t)(size)) <= flow_config.memcap))
#define FlowReference(dst_f_ptr, f) do { \
FlowIncrUsecnt((f)); \
*(dst_f_ptr) = f; \
} while (0)
#define FlowDeReference(src_f_ptr) do { \
FlowDecrUsecnt(*(src_f_ptr)); \
*(src_f_ptr) = NULL; \
} while (0)
Flow *FlowAlloc(void);
Flow *FlowAllocDirect(void);
void FlowFree(Flow *);

Loading…
Cancel
Save