Eliminate zend_string_destroy() wrapper in release build
authorDmitry Stogov <dmitry@zend.com>
Fri, 28 Dec 2018 12:25:57 +0000 (15:25 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 28 Dec 2018 12:25:57 +0000 (15:25 +0300)
Zend/zend_variables.c

index 58b0a99c4af82e4aecc3afd310fefa5c54fb1db6..c057390700fbd7669d118e1f8f4ed5f2364f7e81 100644 (file)
 #include "zend_constants.h"
 #include "zend_list.h"
 
+#if ZEND_DEBUG
 static void ZEND_FASTCALL zend_string_destroy(zend_string *str);
+#else
+# define zend_string_destroy _efree
+#endif
 static void ZEND_FASTCALL zend_reference_destroy(zend_reference *ref);
 static void ZEND_FASTCALL zend_empty_destroy(zend_reference *ref);
 
@@ -53,6 +57,7 @@ ZEND_API void ZEND_FASTCALL rc_dtor_func(zend_refcounted *p)
        zend_rc_dtor_func[GC_TYPE(p)](p);
 }
 
+#if ZEND_DEBUG
 static void ZEND_FASTCALL zend_string_destroy(zend_string *str)
 {
        CHECK_ZVAL_STRING(str);
@@ -61,6 +66,7 @@ static void ZEND_FASTCALL zend_string_destroy(zend_string *str)
        ZEND_ASSERT(!(GC_FLAGS(str) & IS_STR_PERSISTENT));
        efree(str);
 }
+#endif
 
 static void ZEND_FASTCALL zend_reference_destroy(zend_reference *ref)
 {