Skip to content

Commit 0aefc97

Browse files
committed
Adjust comments
1 parent 04a4738 commit 0aefc97

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

ext/process_tags.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)