From c0377818aa198a5b5d0d3c7697373c5b6828d5fa Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Tue, 7 Nov 2023 16:38:48 +0100 Subject: Added tree-sitter vendor library --- vendor/tree-sitter/lib/src/alloc.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 vendor/tree-sitter/lib/src/alloc.h (limited to 'vendor/tree-sitter/lib/src/alloc.h') diff --git a/vendor/tree-sitter/lib/src/alloc.h b/vendor/tree-sitter/lib/src/alloc.h new file mode 100644 index 0000000..c51f84a --- /dev/null +++ b/vendor/tree-sitter/lib/src/alloc.h @@ -0,0 +1,37 @@ +#ifndef TREE_SITTER_ALLOC_H_ +#define TREE_SITTER_ALLOC_H_ + +#include "tree_sitter/api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +extern void *(*ts_current_malloc)(size_t); +extern void *(*ts_current_calloc)(size_t, size_t); +extern void *(*ts_current_realloc)(void *, size_t); +extern void (*ts_current_free)(void *); + +// Allow clients to override allocation functions +#ifndef ts_malloc +#define ts_malloc ts_current_malloc +#endif +#ifndef ts_calloc +#define ts_calloc ts_current_calloc +#endif +#ifndef ts_realloc +#define ts_realloc ts_current_realloc +#endif +#ifndef ts_free +#define ts_free ts_current_free +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ALLOC_H_ -- cgit v1.2.3