Use a separate, re-useable ring-buffer implementation

Not only is it re-useable it also allows for easier debugging by
separating the ring buffer specific logic and the pager history logic.

Hopefully it fixes #3049
This commit is contained in:
Kovid Goyal
2020-12-11 21:17:38 +05:30
parent 3b8be26cc7
commit bffe0f4a6c
5 changed files with 675 additions and 69 deletions
+2 -3
View File
@@ -193,9 +193,8 @@ typedef struct {
} HistoryBufSegment;
typedef struct {
uint8_t *buffer;
size_t buffer_size, max_sz;
size_t start, length;
void *ringbuf;
size_t maximum_size;
bool rewrap_needed;
} PagerHistoryBuf;