Rizin
unix-like reverse engineering framework and cli tools
alloc.h
Go to the documentation of this file.
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_
void(* ts_current_free)(void *)
Definition: alloc.c:35
int size_t
Definition: sftypes.h:40