summaryrefslogtreecommitdiffstats
path: root/lib/buffer.h
diff options
context:
space:
mode:
authorGergely Nagy <algernon@balabit.hu>2012-06-22 15:19:27 +0200
committerGergely Nagy <algernon@balabit.hu>2012-06-22 15:19:27 +0200
commit168dc768a7e5f70f2a0b03402f42a173924522c7 (patch)
tree3780e3581c2fc4532c72710f68eba29b74ae83fa /lib/buffer.h
parent64577eeed64b0c7a188e3d9d1d9b9fa8d0f7bbf5 (diff)
downloadlibumberlog-168dc768a7e5f70f2a0b03402f42a173924522c7.tar.gz
libumberlog-168dc768a7e5f70f2a0b03402f42a173924522c7.tar.xz
libumberlog-168dc768a7e5f70f2a0b03402f42a173924522c7.zip
Use pointers instead of offsets in ul_buffer_t
This avoids various additions and subtractions on the fast path. Signed-off-by: Miloslav Trmač <mitr@redhat.com> Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Diffstat (limited to 'lib/buffer.h')
-rw-r--r--lib/buffer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/buffer.h b/lib/buffer.h
index 359c9c6..c38699e 100644
--- a/lib/buffer.h
+++ b/lib/buffer.h
@@ -32,9 +32,9 @@
typedef struct
{
- size_t alloc;
- size_t len;
- char *msg;
+ char *msg; /* Buffer start */
+ char *ptr; /* Place to append new data */
+ char *alloc_end; /* After last allocated byte */
} ul_buffer_t;
int ul_buffer_reset (ul_buffer_t *buffer)