diff options
author | Gergely Nagy <algernon@balabit.hu> | 2012-06-22 15:19:27 +0200 |
---|---|---|
committer | Gergely Nagy <algernon@balabit.hu> | 2012-06-22 15:19:27 +0200 |
commit | 168dc768a7e5f70f2a0b03402f42a173924522c7 (patch) | |
tree | 3780e3581c2fc4532c72710f68eba29b74ae83fa /lib/buffer.h | |
parent | 64577eeed64b0c7a188e3d9d1d9b9fa8d0f7bbf5 (diff) | |
download | libumberlog-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.h | 6 |
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) |