Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromphp/php-src

Commit38f10ff

Browse files
committed
Fix GC tracing
Due to the GC changes in 7.3 we stopped tracing most of theinteresting coloring changes...
1 parentbff2743 commit38f10ff

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

‎Zend/zend_gc.c‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@
8686
#defineGC_GREY 0x200000
8787
#defineGC_PURPLE 0x300000
8888

89+
/* Debug tracing */
90+
#ifZEND_GC_DEBUG>1
91+
# defineGC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__);
92+
# defineGC_TRACE_REF(ref,format, ...) \
93+
do { \
94+
gc_trace_ref((zend_refcounted *) ref); \
95+
fprintf(stderr, format "\n", ##__VA_ARGS__); \
96+
} while (0)
97+
# defineGC_TRACE_SET_COLOR(ref,color) \
98+
GC_TRACE_REF(ref, "->%s", gc_color_name(color))
99+
#else
100+
# defineGC_TRACE_REF(ref,format, ...)
101+
# defineGC_TRACE_SET_COLOR(ref,new_color)
102+
# defineGC_TRACE(str)
103+
#endif
104+
89105
/* GC_INFO access */
90106
#defineGC_REF_ADDRESS(ref) \
91107
(((GC_TYPE_INFO(ref)) & (GC_ADDRESS << GC_INFO_SHIFT)) >> GC_INFO_SHIFT)
@@ -103,16 +119,19 @@
103119
} while (0)
104120

105121
#defineGC_REF_SET_COLOR(ref,c) do { \
122+
GC_TRACE_SET_COLOR(ref, c); \
106123
GC_TYPE_INFO(ref) = \
107124
(GC_TYPE_INFO(ref) & ~(GC_COLOR << GC_INFO_SHIFT)) | \
108125
((c) << GC_INFO_SHIFT); \
109126
} while (0)
110127

111128
#defineGC_REF_SET_BLACK(ref) do { \
129+
GC_TRACE_SET_COLOR(ref, GC_BLACK); \
112130
GC_TYPE_INFO(ref) &= ~(GC_COLOR << GC_INFO_SHIFT); \
113131
} while (0)
114132

115133
#defineGC_REF_SET_PURPLE(ref) do { \
134+
GC_TRACE_SET_COLOR(ref, GC_PURPLE); \
116135
GC_TYPE_INFO(ref) |= (GC_COLOR << GC_INFO_SHIFT); \
117136
} while (0)
118137

@@ -230,21 +249,6 @@ static zend_gc_globals gc_globals;
230249
# defineGC_BENCH_PEAK(peak,counter)
231250
#endif
232251

233-
#ifZEND_GC_DEBUG>1
234-
# defineGC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__);
235-
# defineGC_TRACE_REF(ref,format, ...) \
236-
do { \
237-
gc_trace_ref((zend_refcounted *) ref); \
238-
fprintf(stderr, format "\n", ##__VA_ARGS__); \
239-
} while (0)
240-
# defineGC_TRACE_SET_COLOR(ref,color) \
241-
GC_TRACE_REF(ref, "->%s", gc_color_name(color))
242-
#else
243-
# defineGC_TRACE_REF(ref,format, ...)
244-
# defineGC_TRACE_SET_COLOR(ref,new_color)
245-
# defineGC_TRACE(str)
246-
#endif
247-
248252

249253
#defineGC_STACK_SEGMENT_SIZE (((4096 - ZEND_MM_OVERHEAD) / sizeof(void*)) - 2)
250254

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp