From: Michael Wallner Date: Fri, 2 Nov 2018 11:47:45 +0000 (+0100) Subject: interned strings++ X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=commitdiff_plain;h=35060621f2fd5079502543d17942127c1a602f72 interned strings++ --- diff --git a/TODO b/TODO index 1e14626..3e6e55a 100644 --- a/TODO +++ b/TODO @@ -2,10 +2,8 @@ * let the various list types be hashtables where appropriate * check out jit-dynamic * fix arginfo with nullable types -* pemalloc * think about a better system for EXTVARs, separate \set and \get functions are clunky -* impl_def_val: allow num_exp * fix right recursion of let_exp and set_exp * improve varargs support, currently it's impossible to map e.g. curl_easy_setopt -* cpp: asm aliasing/redirects * impl_var.name: remove leading '$' +* really solve the array/pointer problem diff --git a/src/types/decl_extvar.c b/src/types/decl_extvar.c index 4490a0a..21323da 100644 --- a/src/types/decl_extvar.c +++ b/src/types/decl_extvar.c @@ -134,7 +134,7 @@ struct psi_decl *psi_decl_extvar_setter(struct psi_decl_extvar *evar) smart_str_append_ex(&name, func_var->name, 1); smart_str_appendl_ex(&name, ZEND_STRL("_set"), 1); zend_string_release(func_var->name); - func_var->name = smart_str_extract(&name); + func_var->name = zend_new_interned_string(smart_str_extract(&name)); decl->extvar = 1; @@ -157,7 +157,7 @@ struct psi_decl *psi_decl_extvar_getter(struct psi_decl_extvar *evar) smart_str_append_ex(&name, func_var->name, 1); smart_str_appendl_ex(&name, ZEND_STRL("_get"), 1); zend_string_release(func_var->name); - func_var->name = smart_str_extract(&name); + func_var->name = zend_new_interned_string(smart_str_extract(&name)); decl->extvar = 1;