Ditch dlmalloc in favour of custom umalloc

This commit is contained in:
2025-09-27 22:32:38 +02:00
parent 3b1bb9d531
commit 8d081bedb0
13 changed files with 114 additions and 110 deletions

View File

@ -28,25 +28,25 @@ void tz_tokenize(Tokenizer *tz) {
size_t len = string_len(tz->str);
for (size_t i = 0; i < len; i++) {
if (tz->str[i] == '\'') {
char *str = dlmalloc(TZ_MAX_TK);
char *str = umalloc(TZ_MAX_TK);
string_memset(str, 0, TZ_MAX_TK);
i++;
size_t j = 0;
while (i < len && tz->str[i] != '\'') {
str[j++] = tz->str[i++];
}
Token *tk = dlmalloc(sizeof(*tk));
Token *tk = umalloc(sizeof(*tk));
tk->str = str;
tk->next = NULL;
LL_APPEND(tz->tokens, tk);
} else {
char *tkstr = dlmalloc(TZ_MAX_TK);
char *tkstr = umalloc(TZ_MAX_TK);
string_memset(tkstr, 0, TZ_MAX_TK);
size_t j = 0;
while (i < len && !string_chr_isspace(tz->str[i])) {
tkstr[j++] = tz->str[i++];
}
Token *tk = dlmalloc(sizeof(*tk));
Token *tk = umalloc(sizeof(*tk));
tk->str = tkstr;
tk->next = NULL;
LL_APPEND(tz->tokens, tk);