diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-08 10:52:29 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-08 10:54:18 +0200 |
commit | 38f10ff5cf4fbf6fc03ad24370b89cd631512f1d (patch) | |
tree | 0410d2a4bbf91c8090263d6ecd9f8de1bd7ef507 | |
parent | bff2743caf93332dd4a2ca658f50dc3c1d8cb144 (diff) | |
download | php-git-38f10ff5cf4fbf6fc03ad24370b89cd631512f1d.tar.gz |
Fix GC tracing
Due to the GC changes in 7.3 we stopped tracing most of the
interesting coloring changes...
-rw-r--r-- | Zend/zend_gc.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 7280fdd20d..8b9ee17632 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -86,6 +86,22 @@ #define GC_GREY 0x200000 #define GC_PURPLE 0x300000 +/* Debug tracing */ +#if ZEND_GC_DEBUG > 1 +# define GC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__); +# define GC_TRACE_REF(ref, format, ...) \ + do { \ + gc_trace_ref((zend_refcounted *) ref); \ + fprintf(stderr, format "\n", ##__VA_ARGS__); \ + } while (0) +# define GC_TRACE_SET_COLOR(ref, color) \ + GC_TRACE_REF(ref, "->%s", gc_color_name(color)) +#else +# define GC_TRACE_REF(ref, format, ...) +# define GC_TRACE_SET_COLOR(ref, new_color) +# define GC_TRACE(str) +#endif + /* GC_INFO access */ #define GC_REF_ADDRESS(ref) \ (((GC_TYPE_INFO(ref)) & (GC_ADDRESS << GC_INFO_SHIFT)) >> GC_INFO_SHIFT) @@ -103,16 +119,19 @@ } while (0) #define GC_REF_SET_COLOR(ref, c) do { \ + GC_TRACE_SET_COLOR(ref, c); \ GC_TYPE_INFO(ref) = \ (GC_TYPE_INFO(ref) & ~(GC_COLOR << GC_INFO_SHIFT)) | \ ((c) << GC_INFO_SHIFT); \ } while (0) #define GC_REF_SET_BLACK(ref) do { \ + GC_TRACE_SET_COLOR(ref, GC_BLACK); \ GC_TYPE_INFO(ref) &= ~(GC_COLOR << GC_INFO_SHIFT); \ } while (0) #define GC_REF_SET_PURPLE(ref) do { \ + GC_TRACE_SET_COLOR(ref, GC_PURPLE); \ GC_TYPE_INFO(ref) |= (GC_COLOR << GC_INFO_SHIFT); \ } while (0) @@ -230,21 +249,6 @@ static zend_gc_globals gc_globals; # define GC_BENCH_PEAK(peak, counter) #endif -#if ZEND_GC_DEBUG > 1 -# define GC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__); -# define GC_TRACE_REF(ref, format, ...) \ - do { \ - gc_trace_ref((zend_refcounted *) ref); \ - fprintf(stderr, format "\n", ##__VA_ARGS__); \ - } while (0) -# define GC_TRACE_SET_COLOR(ref, color) \ - GC_TRACE_REF(ref, "->%s", gc_color_name(color)) -#else -# define GC_TRACE_REF(ref, format, ...) -# define GC_TRACE_SET_COLOR(ref, new_color) -# define GC_TRACE(str) -#endif - #define GC_STACK_SEGMENT_SIZE (((4096 - ZEND_MM_OVERHEAD) / sizeof(void*)) - 2) |