summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-15 10:11:38 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-15 10:11:38 +0100
commit62b5ae05d6810bc00092076ccd0b52aab8096e60 (patch)
treedc2732c8497ec7c72c3cda714a7b7ca55013d232 /runtime
parent855b68e1be652b4c51052969a9550d33b2aec612 (diff)
downloadrsyslog-62b5ae05d6810bc00092076ccd0b52aab8096e60.tar.gz
rsyslog-62b5ae05d6810bc00092076ccd0b52aab8096e60.tar.bz2
rsyslog-62b5ae05d6810bc00092076ccd0b52aab8096e60.zip
optimize: use fixed size (8 bits) instead of enum
looks like GCC, even if optimizing, uses 32 bits - at least this is suggested by the profiler results (both in terms of runtime and cache misses).
Diffstat (limited to 'runtime')
-rw-r--r--runtime/batch.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/batch.h b/runtime/batch.h
index 0f19f5bb..097e104a 100644
--- a/runtime/batch.h
+++ b/runtime/batch.h
@@ -34,13 +34,12 @@
* main message queue. But over time, it could potentially be useful to split the two.
* rgerhad, 2009-05-12
*/
-typedef enum {
- BATCH_STATE_RDY = 0, /* object ready for processing */
- BATCH_STATE_BAD = 1, /* unrecoverable failure while processing, do NOT resubmit to same action */
- BATCH_STATE_SUB = 2, /* message submitted for processing, outcome yet unknown */
- BATCH_STATE_COMM = 3, /* message successfully commited */
- BATCH_STATE_DISC = 4, /* discarded - processed OK, but do not submit to any other action */
-} batch_state_t;
+#define BATCH_STATE_RDY 0 /* object ready for processing */
+#define BATCH_STATE_BAD 1 /* unrecoverable failure while processing, do NOT resubmit to same action */
+#define BATCH_STATE_SUB 2 /* message submitted for processing, outcome yet unknown */
+#define BATCH_STATE_COMM 3 /* message successfully commited */
+#define BATCH_STATE_DISC 4 /* discarded - processed OK, but do not submit to any other action */
+typedef unsigned char batch_state_t;
/* an object inside a batch, including any information (state!) needed for it to "life".