aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.h
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-06-30 13:37:19 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-07-01 05:40:53 -0300
commit0ef80b9c2b922280c3ba2c0a8638f23ae57d6618 (patch)
treec8d6f5631df1e8eb69022cae647f6e0436254830 /src/nvim/memory.h
parentdcaf9c6bc3d5f83782fca7a145ba5feac7746b1e (diff)
downloadrneovim-0ef80b9c2b922280c3ba2c0a8638f23ae57d6618.tar.gz
rneovim-0ef80b9c2b922280c3ba2c0a8638f23ae57d6618.tar.bz2
rneovim-0ef80b9c2b922280c3ba2c0a8638f23ae57d6618.zip
rbuffer: Reimplement as a ring buffer and decouple from rstream
Extract the RBuffer class from rstream.c and reimplement it as a ring buffer, a more efficient version that doesn't need to relocate memory. The old rbuffer_read/rbuffer_write interfaces are kept for simple reading/writing, and the RBUFFER_UNTIL_{FULL,EMPTY} macros are introduced to hide wrapping logic when more control is required(such as passing the buffer pointer to a library function that writes directly to the pointer) Also add a basic infrastructure for writing helper C files that are only compiled in the unit test library, and use this to write unit tests for RBuffer which contains some macros that can't be accessed directly by luajit. Helped-by: oni-link <knil.ino@gmail.com> Reviewed-by: oni-link <knil.ino@gmail.com> Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com>
Diffstat (limited to 'src/nvim/memory.h')
-rw-r--r--src/nvim/memory.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/memory.h b/src/nvim/memory.h
index 4ff31ff732..7b477da2f5 100644
--- a/src/nvim/memory.h
+++ b/src/nvim/memory.h
@@ -1,6 +1,7 @@
#ifndef NVIM_MEMORY_H
#define NVIM_MEMORY_H
+#include <stdint.h> // for uint8_t
#include <stddef.h> // for size_t
#ifdef INCLUDE_GENERATED_DECLARATIONS