diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2010-01-11 09:36:21 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2010-01-11 09:36:21 +0100 |
commit | 24fc7972bec0060002d48826b07af3a352fb51ef (patch) | |
tree | 45ba06e29ad2eb331c7c653d147d1b95eebf02b0 /lf_ring_buffer2.h | |
parent | 77d867d6aef140b30a39b55e4456c1a8e58481f1 (diff) | |
download | lock_free-24fc7972bec0060002d48826b07af3a352fb51ef.zip lock_free-24fc7972bec0060002d48826b07af3a352fb51ef.tar.gz |
more comments, code cleanup in ring buffer 2
Diffstat (limited to 'lf_ring_buffer2.h')
-rw-r--r-- | lf_ring_buffer2.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lf_ring_buffer2.h b/lf_ring_buffer2.h index 6f0cee1..acf9974 100644 --- a/lf_ring_buffer2.h +++ b/lf_ring_buffer2.h @@ -38,13 +38,14 @@ extern "C" { #define LFRB_NO_BLOCK 1 /* if buffer is full, leave instead of try again and again */ #define IS_NOT_BLOCKING( flags ) ( (flags)&LFRB_NO_BLOCK ) +/* the ring buffer structure */ typedef struct ring_buffer { LFRB_BUFFER_TYPE *buffer; /* buffer data */ - size_t n_buf; /* number of buffers */ - unsigned int indexes; /* indexes where to read from and write data to */ + size_t n_buf; /* number of buffers, max 65534, see implementation for details */ + unsigned int indexes; /* indexes where to read_from and write_to */ } lf_ring_buffer_t; -/* return an initialized lf_ring_buffer_t struct */ +/* return an initialized lf_ring_buffer_t struct, size is limited to 65534, see implementation for details */ lf_ring_buffer_t* lf_ring_buffer_create( size_t n_buf ); /* destroy an lf_ring_buffer_t struct */ |