aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-06-07 14:05:26 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-09-28 14:31:03 +0200
commit8ff2f193bb3ed94ee215c83c13431d45d382949b (patch)
tree557d3fcc28cec67ce1705ebb0c25ff96028d01b0 /src
parent3bddf050230635febc16aabe0ba4f73abeed6663 (diff)
downloadrneovim-8ff2f193bb3ed94ee215c83c13431d45d382949b.tar.gz
rneovim-8ff2f193bb3ed94ee215c83c13431d45d382949b.tar.bz2
rneovim-8ff2f193bb3ed94ee215c83c13431d45d382949b.zip
tree-sitter: change vendored tree-sitter to use nvim memory management
Diffstat (limited to 'src')
-rw-r--r--src/tree_sitter/alloc.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tree_sitter/alloc.h b/src/tree_sitter/alloc.h
index c8fe6c6e6d..2229995bd1 100644
--- a/src/tree_sitter/alloc.h
+++ b/src/tree_sitter/alloc.h
@@ -9,7 +9,20 @@ extern "C" {
#include <stdbool.h>
#include <stdio.h>
-#if defined(TREE_SITTER_TEST)
+#include "nvim/memory.h"
+
+#if 1
+
+static inline bool ts_toggle_allocation_recording(bool value) {
+ return false;
+}
+
+#define ts_malloc xmalloc
+#define ts_calloc xcalloc
+#define ts_realloc xrealloc
+#define ts_free xfree
+
+#elif defined(TREE_SITTER_TEST)
void *ts_record_malloc(size_t);
void *ts_record_calloc(size_t, size_t);