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

@ -6,7 +6,7 @@
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/03 13:20:01 by maiboyer #+# #+# #
# Updated: 2024/05/12 17:13:38 by maiboyer ### ########.fr #
# Updated: 2024/05/14 15:26:21 by maiboyer ### ########.fr #
# #
# **************************************************************************** #
@ -78,4 +78,4 @@ re:
generate_filelist:
@/usr/bin/env zsh -c "tree -iFf --noreport $(SRC_DIR) | rg '^$(SRC_DIR)/(.*)\.c\$$' --replace '\$$1' | sort -u" > ./source_files.list
# -include $(DEPS)
-include $(DEPS)

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) \