}
/* Create a short living interned, freed after the request. */
- ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT));
+#if ZEND_RC_DEBUG
+ if (zend_rc_debug) {
+ /* PHP shouldn't create persistent interned string during request,
+ * but at least dl() may do this */
+ ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT));
+ }
+#endif
if (GC_REFCOUNT(str) > 1) {
zend_ulong h = ZSTR_H(str);
zend_string_delref(str);
return ret;
}
+ ZEND_ASSERT(permanent);
ret = zend_string_init(str, size, permanent);
ZSTR_H(ret) = h;
return zend_add_interned_string(ret, &interned_strings_permanent, IS_STR_PERMANENT);
return ret;
}
+#if ZEND_RC_DEBUG
+ if (zend_rc_debug) {
+ /* PHP shouldn't create persistent interned string during request,
+ * but at least dl() may do this */
+ ZEND_ASSERT(!permanent);
+ }
+#endif
ret = zend_string_init(str, size, permanent);
ZSTR_H(ret) = h;