X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fdata.c;h=2898ff1e332ee8732dfcc26bf3bdba08eafbd21d;hp=e09c472a7b887fbcbcafa4fb75bf0e3de5f9534f;hb=93d6b7f962a82b725d1918684297d68221b0b733;hpb=d9f1274417f65d980e143700726d1527462123d3 diff --git a/src/data.c b/src/data.c index e09c472..2898ff1 100644 --- a/src/data.c +++ b/src/data.c @@ -23,15 +23,49 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ -#include "php_psi_stdinc.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +# include "php_config.h" +#endif #include "php_psi.h" #include "data.h" #include "php_globals.h" +#include "zend_types.h" #include #include +#if PSI_THREADED_PARSER +# include + +static pthread_mutex_t psi_string_mutex = PTHREAD_MUTEX_INITIALIZER; + +zend_string *psi_string_init_interned(const char *buf, size_t len, int p) +{ + zend_string *str; + + pthread_mutex_lock(&psi_string_mutex); + str = zend_string_init_interned(buf, len, p); + pthread_mutex_unlock(&psi_string_mutex); + + return str; +} + +zend_string *psi_new_interned_string(zend_string *str) +{ + zend_string *new_str; + + pthread_mutex_lock(&psi_string_mutex); + new_str = zend_new_interned_string(str); + pthread_mutex_unlock(&psi_string_mutex); + + return new_str; +} + +#endif + static void psi_data_ctor_internal(struct psi_data *data, psi_error_cb error, unsigned flags) { @@ -252,13 +286,13 @@ void psi_data_dump(struct psi_dump *dump, struct psi_data *D) while (psi_plist_get(D->decls, i++, &decl)) { if (decl->extvar) { - PSI_DUMP(dump, "/* extvar accessor\n"); + PSI_DUMP(dump, "/* extvar accessor \n"); } psi_decl_dump(dump, decl); - PSI_DUMP(dump, "\n"); if (decl->extvar) { - PSI_DUMP(dump, " extvar accessor */\n"); + PSI_DUMP(dump, " */"); } + PSI_DUMP(dump, "\n"); } PSI_DUMP(dump, "\n"); }