Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/tree-sitter-omega/blob/main/src/tree_sitter/alloc.h # tree-sitter-omega aien-dev/tree-sitter-omega Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `tree-sitter-omega / src / tree_sitter / alloc.h` 54 lines ยท 985 bytes Raw Blame History 1 #ifndef TREE_SITTER_ALLOC_H_ 2 #define TREE_SITTER_ALLOC_H_ 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include 9 #include 10 #include 11 12 // Allow clients to override allocation functions 13 #ifdef TREE_SITTER_REUSE_ALLOCATOR 14 15 extern void *(*ts_current_malloc)(size_t size); 16 extern void *(*ts_current_calloc)(size_t count, size_t size); 17 extern void *(*ts_current_realloc)(void *ptr, size_t size); 18 extern void (*ts_current_free)(void *ptr); 19 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 #else 34 35 #ifndef ts_malloc 36 #define ts_malloc malloc 37 #endif 38 #ifndef ts_calloc 39 #define ts_calloc calloc 40 #endif 41 #ifndef ts_realloc 42 #define ts_realloc realloc 43 #endif 44 #ifndef ts_free 45 #define ts_free free 46 #endif 47 48 #endif 49 50 #ifdef __cplusplus 51 } 52 #endif 53 54 #endif // TREE_SITTER_ALLOC_H_