From 224236f57c7d645c9b23d717de354df5d12b98b6 Mon Sep 17 00:00:00 2001 From: Vlad Vissoultchev Date: Sun, 17 Apr 2016 16:37:23 +0300 Subject: Improve hash performance - better `TOK_HASH_FUNC` - increases `hash_ident` initial size to 16k (from 8k) - `cstr_cat` uses single `realloc` + `memcpy` - `cstr_cat` can append terminating zero - `tok_str_realloc` initial size to 16 (from 8) - `parse_define` uses static `tokstr_buf` - `next` uses static `tokstr_buf` - fixes two latent bugs (wrong deallocations in libtcc.c:482 and tccpp.c:2987) --- tccgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tccgen.c') diff --git a/tccgen.c b/tccgen.c index 8bf7007..b9681df 100644 --- a/tccgen.c +++ b/tccgen.c @@ -3395,7 +3395,7 @@ ST_FUNC void parse_asm_str(CString *astr) cstr_new(astr); while (tok == TOK_STR) { /* XXX: add \0 handling too ? */ - cstr_cat(astr, tokc.str.data); + cstr_cat(astr, tokc.str.data, -1); next(); } cstr_ccat(astr, '\0'); -- cgit v1.3.1