Ditch dlmalloc in favour of custom umalloc
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user