From 168dc768a7e5f70f2a0b03402f42a173924522c7 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 22 Jun 2012 15:19:27 +0200 Subject: Use pointers instead of offsets in ul_buffer_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids various additions and subtractions on the fast path. Signed-off-by: Miloslav Trmač Signed-off-by: Gergely Nagy --- lib/buffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/buffer.h') 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) -- cgit