Put the custom allocator in its own lib, as to lessen the difficulty to switch between libc's allocator and a custom one (#7)

This commit is contained in:
Maix0 2024-05-14 18:56:53 +02:00 committed by GitHub
parent 713f0f0302
commit cb7f3c3fdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 1121 additions and 877 deletions

View file

@ -1,7 +1,7 @@
#ifndef TREE_SITTER_ARRAY_H_
#define TREE_SITTER_ARRAY_H_
#include "me/alloc/alloc.h"
#include "me/mem/mem.h"
#include <assert.h>
#include <ctype.h>
#include <limits.h>
@ -39,16 +39,16 @@
#define STACK_VERSION_NONE ((t_stack_version)-1)
#define TS_DECODE_ERROR (-1)
#if true
#if false
# undef malloc
# undef calloc
# undef realloc
# undef free
# define malloc(s) me_malloc((s))
# define calloc(s, l) me_calloc((s), (l))
# define realloc(p, t) me_realloc((p), (t))
# define free(p) me_free((p))
# define calloc(s, l) mem_alloc_array((s), (l))
# define realloc(p, t) mem_realloc((p), (t))
# define free(p) mem_free((p))
#endif
#define Array(T) \