Skip to content

Conversation

@TysonAndre
Copy link
Contributor

@TysonAndre TysonAndre commented Aug 12, 2016

(There are no interned strings in ZTS, see the definition of
zend_new_interned_string_int)

Fixes #247

See discussion in #254

On NTS, strings must be non-interned in order to last until module shutdown. If registerExtension is passed a literal string constant, it is probably(?) interned.
ZTS doesn't have any interned strings.

Only one test has been run with valgrind(tests/extensions_basic.phpt)

Valgrind checks for invalid memory accesses and memory leaks.

"-m" makes php unit tests use valgrind (and malloc instead of emalloc, etc.)
@TysonAndre TysonAndre changed the title Use an interned zend_string for registerExtension on ZTS Use an non-interned zend_string for registerExtension on ZTS Aug 12, 2016
v8js_class.cc Outdated
}
delete jsext->extension;
// jsext->name and jsext->source are interned, this would do nothing.
// Interned strings will be freed after module shutdown (On ZTS - But on NTS, they're actually interned)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is (now) misleading/wrong, since the strings are guaranteed not to be interned

(There are no interned strings in ZTS, see the definition of
 zend_new_interned_string_int)

On NTS, strings must be non-interned in order to last until module shutdown.
interned strings are cleaned up before module shutdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants