File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,9 +55,7 @@ static void clear_process_tags(void) {
5555 }
5656
5757 if (process_tags .serialized ) {
58- // Counterpart to the IS_STR_INTERNED flag set in serialize_process_tags:
59- // zend_string_release no-ops on interned strings, so clear the flag
60- // first to actually free the underlying persistent allocation.
58+ // Counterpart to the IS_STR_INTERNED flag set in serialize_process_tags
6159 GC_DEL_FLAGS (process_tags .serialized , IS_STR_INTERNED );
6260 zend_string_release (process_tags .serialized );
6361 }
@@ -259,11 +257,7 @@ static void serialize_process_tags(void) {
259257 if (buf .s ) {
260258 smart_str_0 (& buf );
261259 process_tags .serialized = zend_string_init (ZSTR_VAL (buf .s ), ZSTR_LEN (buf .s ), 1 );
262- // Process-wide shared string: pre-compute h (interned strings are
263- // expected to have it set; callers may read ZSTR_H() raw) then mark
264- // interned (= GC_IMMUTABLE) so the convert_to_bytes refcount helpers
265- // skip the non-atomic ++/-- that would otherwise race across ZTS
266- // threads.
260+ // Intern to avoid races with string touched by refcounting; but just the flag, no need for the whole persisting ceremony
267261 zend_string_hash_val (process_tags .serialized );
268262 GC_ADD_FLAGS (process_tags .serialized , IS_STR_INTERNED );
269263 }
You can’t perform that action at this time.
0 commit comments