CoolFace
Apppublic

aravagarwal/CodeCloakPII

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
alloc.h61 linesDownload Raw Back to tree_sitter
1#ifndef TREE_SITTER_ALLOC_H_2#define TREE_SITTER_ALLOC_H_3 4#ifdef __cplusplus5extern "C" {6#endif7 8#include <stdbool.h>9#include <stdio.h>10#include <stdlib.h>11 12#ifdef _WIN3213#define TS_PUBLIC __declspec(dllexport)14#else15#define TS_PUBLIC __attribute__((visibility("default")))16#endif17 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 functions24#ifdef TS_REUSE_ALLOCATOR25 26#ifndef ts_malloc27#define ts_malloc  ts_current_malloc28#endif29#ifndef ts_calloc30#define ts_calloc  ts_current_calloc31#endif32#ifndef ts_realloc33#define ts_realloc ts_current_realloc34#endif35#ifndef ts_free36#define ts_free    ts_current_free37#endif38 39#else40 41#ifndef ts_malloc42#define ts_malloc  malloc43#endif44#ifndef ts_calloc45#define ts_calloc  calloc46#endif47#ifndef ts_realloc48#define ts_realloc realloc49#endif50#ifndef ts_free51#define ts_free    free52#endif53 54#endif55 56#ifdef __cplusplus57}58#endif59 60#endif // TREE_SITTER_ALLOC_H_61