diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-11-07 16:38:48 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-11-07 16:38:48 +0100 |
| commit | c0377818aa198a5b5d0d3c7697373c5b6828d5fa (patch) | |
| tree | 8deb7109e9c996884a6a86ab46ec6190e793c532 /vendor/tree-sitter/lib/src/alloc.h | |
| parent | f9dcd08833afdfb3b4446cb842d3ecd4469c5638 (diff) | |
| download | crep-c0377818aa198a5b5d0d3c7697373c5b6828d5fa.tar.gz | |
Added tree-sitter vendor library
Diffstat (limited to 'vendor/tree-sitter/lib/src/alloc.h')
| -rw-r--r-- | vendor/tree-sitter/lib/src/alloc.h | 37 |
1 files changed, 37 insertions, 0 deletions
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 @@ | |||
| 1 | #ifndef TREE_SITTER_ALLOC_H_ | ||
| 2 | #define TREE_SITTER_ALLOC_H_ | ||
| 3 | |||
| 4 | #include "tree_sitter/api.h" | ||
| 5 | |||
| 6 | #ifdef __cplusplus | ||
| 7 | extern "C" { | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #include <stdlib.h> | ||
| 11 | #include <stdbool.h> | ||
| 12 | #include <stdio.h> | ||
| 13 | |||
| 14 | extern void *(*ts_current_malloc)(size_t); | ||
| 15 | extern void *(*ts_current_calloc)(size_t, size_t); | ||
| 16 | extern void *(*ts_current_realloc)(void *, size_t); | ||
| 17 | extern void (*ts_current_free)(void *); | ||
| 18 | |||
| 19 | // Allow clients to override allocation functions | ||
| 20 | #ifndef ts_malloc | ||
| 21 | #define ts_malloc ts_current_malloc | ||
| 22 | #endif | ||
| 23 | #ifndef ts_calloc | ||
| 24 | #define ts_calloc ts_current_calloc | ||
| 25 | #endif | ||
| 26 | #ifndef ts_realloc | ||
| 27 | #define ts_realloc ts_current_realloc | ||
| 28 | #endif | ||
| 29 | #ifndef ts_free | ||
| 30 | #define ts_free ts_current_free | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef __cplusplus | ||
| 34 | } | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #endif // TREE_SITTER_ALLOC_H_ | ||
