aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h')
-rw-r--r--vendor/github.com/mitjafelicijan/go-tree-sitter/alloc.h41
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
5extern "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
18TS_PUBLIC extern void *(*ts_current_malloc)(size_t);
19TS_PUBLIC extern void *(*ts_current_calloc)(size_t, size_t);
20TS_PUBLIC extern void *(*ts_current_realloc)(void *, size_t);
21TS_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_