#include "util-debug.h"
#include "stream-tcp.h"
+#ifdef DEBUG
static SCMutex stream_pool_memuse_mutex;
static uint64_t stream_pool_memuse = 0;
static uint64_t stream_pool_memcnt = 0;
+#endif
/* per queue setting */
static uint16_t toserver_min_chunk_len = 2560;
memset(s, 0, sizeof(StreamMsg));
+#ifdef DEBUG
SCMutexLock(&stream_pool_memuse_mutex);
stream_pool_memuse += sizeof(StreamMsg);
stream_pool_memcnt ++;
SCMutexUnlock(&stream_pool_memuse_mutex);
+#endif
return s;
}
}
void StreamMsgQueuesInit(void) {
+#ifdef DEBUG
SCMutexInit(&stream_pool_memuse_mutex, NULL);
-
+#endif
SCMutexLock(&stream_msg_pool_mutex);
stream_msg_pool = PoolInit(0,250,StreamMsgAlloc,NULL,StreamMsgFree);
if (stream_msg_pool == NULL)
PoolFree(stream_msg_pool);
SCMutexUnlock(&stream_msg_pool_mutex);
+#ifdef DEBUG
SCMutexDestroy(&stream_pool_memuse_mutex);
if (quiet == FALSE)
SCLogDebug("stream_pool_memuse %"PRIu64", stream_pool_memcnt %"PRIu64"", stream_pool_memuse, stream_pool_memcnt);
+#endif
}
/** \brief alloc a stream msg queue