From a1c102ed722e7114ff30198cf8f6b1464342e974 Mon Sep 17 00:00:00 2001 From: qpl-public Date: Tue, 19 Jun 2018 14:21:58 +0100 Subject: [PATCH] Introduce max ring buffer size macro. --- readPTU/readTTTRRecords-for-import.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readPTU/readTTTRRecords-for-import.c b/readPTU/readTTTRRecords-for-import.c index 5c4fbbe..015473c 100755 --- a/readPTU/readTTTRRecords-for-import.c +++ b/readPTU/readTTTRRecords-for-import.c @@ -27,6 +27,7 @@ // How big the file chunking will be #define RECORD_CHUNK 1024*8 // 1024*8 gives the best results on Guillem laptop +#define MAX_RING_BUF 4096 int c_fseek(FILE *filehandle, long int offset) { @@ -45,7 +46,7 @@ static inline void load_buffer(uint32_t *pbuffer, FILE *fhandle) static inline void check_and_grow_buf(ring_buf_t *cbuf, uint64_t timetag, uint64_t correlation_window) { - if ( (timetag-ring_buf_oldest(cbuf)) < correlation_window && cbuf->count == cbuf->size && cbuf->size < 256) { + if ( (timetag-ring_buf_oldest(cbuf)) < correlation_window && cbuf->count == cbuf->size && cbuf->size < MAX_RING_BUF) { ring_buf_grow(cbuf); } }