mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Revert "Zend/zend_types.h: move zend_rc_debug to zend_rc_debug.h"
This reverts commit d6e95041e2.
This commit is contained in:
@@ -95,6 +95,10 @@ void (*zend_on_timeout)(int seconds);
|
||||
static void (*zend_message_dispatcher_p)(zend_long message, const void *data);
|
||||
static zval *(*zend_get_configuration_directive_p)(zend_string *name);
|
||||
|
||||
#if ZEND_RC_DEBUG
|
||||
ZEND_API bool zend_rc_debug = 0;
|
||||
#endif
|
||||
|
||||
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
|
||||
{
|
||||
if (!new_value) {
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "zend_ini.h"
|
||||
#include "zend_enum.h"
|
||||
#include "zend_observer.h"
|
||||
#include "zend_rc_debug.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "zend_rc_debug.h"
|
||||
|
||||
#if ZEND_RC_DEBUG
|
||||
ZEND_API bool zend_rc_debug = false;
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef ZEND_RC_DEBUG_H
|
||||
#define ZEND_RC_DEBUG_H
|
||||
|
||||
#ifndef ZEND_RC_DEBUG
|
||||
# define ZEND_RC_DEBUG 0
|
||||
#endif
|
||||
|
||||
#if ZEND_RC_DEBUG
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# include "zend_config.w32.h"
|
||||
#else
|
||||
# include "zend_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern ZEND_API bool zend_rc_debug;
|
||||
|
||||
/* The GC_PERSISTENT flag is reused for IS_OBJ_WEAKLY_REFERENCED on objects.
|
||||
* Skip checks for OBJECT/NULL type to avoid interpreting the flag incorrectly. */
|
||||
# define ZEND_RC_MOD_CHECK(p) do { \
|
||||
if (zend_rc_debug) { \
|
||||
uint8_t type = zval_gc_type((p)->u.type_info); \
|
||||
if (type != IS_OBJECT && type != IS_NULL) { \
|
||||
ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
|
||||
ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
# define ZEND_RC_MOD_CHECK(p) \
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
#endif /* ZEND_RC_DEBUG_H */
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_rc_debug.h"
|
||||
|
||||
#ifdef HAVE_VALGRIND
|
||||
# include "valgrind/callgrind.h"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "zend_portability.h"
|
||||
#include "zend_long.h"
|
||||
#include "zend_rc_debug.h"
|
||||
#include "zend_result.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
@@ -1162,11 +1161,29 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) {
|
||||
#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z))
|
||||
#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z))
|
||||
|
||||
#ifndef ZEND_RC_DEBUG
|
||||
# define ZEND_RC_DEBUG 0
|
||||
#endif
|
||||
|
||||
#if ZEND_RC_DEBUG
|
||||
extern ZEND_API bool zend_rc_debug;
|
||||
/* The GC_PERSISTENT flag is reused for IS_OBJ_WEAKLY_REFERENCED on objects.
|
||||
* Skip checks for OBJECT/NULL type to avoid interpreting the flag incorrectly. */
|
||||
# define ZEND_RC_MOD_CHECK(p) do { \
|
||||
if (zend_rc_debug) { \
|
||||
uint8_t type = zval_gc_type((p)->u.type_info); \
|
||||
if (type != IS_OBJECT && type != IS_NULL) { \
|
||||
ZEND_ASSERT(!(zval_gc_flags((p)->u.type_info) & GC_IMMUTABLE)); \
|
||||
ZEND_ASSERT((zval_gc_flags((p)->u.type_info) & (GC_PERSISTENT|GC_PERSISTENT_LOCAL)) != GC_PERSISTENT); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
# define GC_MAKE_PERSISTENT_LOCAL(p) do { \
|
||||
GC_ADD_FLAGS(p, GC_PERSISTENT_LOCAL); \
|
||||
} while (0)
|
||||
#else
|
||||
# define ZEND_RC_MOD_CHECK(p) \
|
||||
do { } while (0)
|
||||
# define GC_MAKE_PERSISTENT_LOCAL(p) \
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
@@ -1723,7 +1723,7 @@ PHP_ADD_SOURCES(Zend, \
|
||||
zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \
|
||||
zend_default_classes.c zend_inheritance.c zend_smart_str.c zend_cpuinfo.c zend_gdb.c \
|
||||
zend_observer.c zend_system_id.c zend_enum.c zend_fibers.c zend_atomic.c \
|
||||
zend_rc_debug.c zend_max_execution_timer.c \
|
||||
zend_max_execution_timer.c \
|
||||
Optimizer/zend_optimizer.c \
|
||||
Optimizer/pass1.c \
|
||||
Optimizer/pass3.c \
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
#include "zend_ini.h"
|
||||
#include "zend_dtrace.h"
|
||||
#include "zend_observer.h"
|
||||
#include "zend_rc_debug.h"
|
||||
#include "zend_system_id.h"
|
||||
|
||||
#include "php_content_types.h"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "php_version.h"
|
||||
#include "zend.h"
|
||||
#include "zend_rc_debug.h"
|
||||
#include "zend_sort.h"
|
||||
#include "php_compat.h"
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "ext/standard/dl.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_highlight.h"
|
||||
#include "zend_rc_debug.h"
|
||||
#include "SAPI.h"
|
||||
#include "php_main.h"
|
||||
#include "php_scandir.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "php.h"
|
||||
#include "zend_ini_scanner.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_rc_debug.h"
|
||||
#include "zend_stream.h"
|
||||
|
||||
#include "SAPI.h"
|
||||
|
||||
Reference in New Issue
Block a user