diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 20:22:09 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 20:22:09 +0100 |
| commit | 5a8dbc6347b3541e84fe669b22c17ad3b715e258 (patch) | |
| tree | b148c450939688caaaeb4adac6f2faa1eaffe649 /vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h | |
| download | qwe-editor-5a8dbc6347b3541e84fe669b22c17ad3b715e258.tar.gz | |
Engage!
Diffstat (limited to 'vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h')
| -rw-r--r-- | vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h b/vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h new file mode 100644 index 0000000..a0eadb7 --- /dev/null +++ b/vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #ifndef TREE_SITTER_ALLOC_H_ | ||
| 2 | #define TREE_SITTER_ALLOC_H_ | ||
| 3 | |||
| 4 | #ifdef __cplusplus | ||
| 5 | extern "C" { | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #include <stdbool.h> | ||
| 9 | #include <stdio.h> | ||
| 10 | #include <stdlib.h> | ||
| 11 | |||
| 12 | #if defined(TREE_SITTER_HIDDEN_SYMBOLS) || defined(_WIN32) | ||
| 13 | #define TS_PUBLIC | ||
| 14 | #else | ||
| 15 | #define TS_PUBLIC __attribute__((visibility("default"))) | ||
| 16 | #endif | ||
| 17 | |||
| 18 | TS_PUBLIC extern void *(*ts_current_malloc)(size_t); | ||
| 19 | TS_PUBLIC extern void *(*ts_current_calloc)(size_t, size_t); | ||
| 20 | TS_PUBLIC extern void *(*ts_current_realloc)(void *, size_t); | ||
| 21 | TS_PUBLIC extern void (*ts_current_free)(void *); | ||
| 22 | |||
| 23 | // Allow clients to override allocation functions | ||
| 24 | #ifndef ts_malloc | ||
| 25 | #define ts_malloc ts_current_malloc | ||
| 26 | #endif | ||
| 27 | #ifndef ts_calloc | ||
| 28 | #define ts_calloc ts_current_calloc | ||
| 29 | #endif | ||
| 30 | #ifndef ts_realloc | ||
| 31 | #define ts_realloc ts_current_realloc | ||
| 32 | #endif | ||
| 33 | #ifndef ts_free | ||
| 34 | #define ts_free ts_current_free | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifdef __cplusplus | ||
| 38 | } | ||
| 39 | #endif | ||
| 40 | |||
| 41 | #endif // TREE_SITTER_ALLOC_H_ | ||
