/* {{{ _mysqlnd_debug */
PHPAPI void _mysqlnd_debug(const char * mode TSRMLS_DC)
{
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
MYSQLND_DEBUG *dbg = MYSQLND_G(dbg);
if (!dbg) {
MYSQLND_G(dbg) = dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = emalloc(REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_ENTER(mysqlnd_pemalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = pemalloc(REAL_SIZE(size), persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = ecalloc(nmemb, REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_ENTER(mysqlnd_pecalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = pecalloc(nmemb, REAL_SIZE(size), persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = erealloc(REAL_PTR(ptr), REAL_SIZE(new_size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = perealloc(REAL_PTR(ptr), REAL_SIZE(new_size), persistent);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_ENTER(mysqlnd_malloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = malloc(REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_ENTER(mysqlnd_calloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = calloc(nmemb, REAL_SIZE(size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
DBG_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
DBG_INF_FMT("before: %lu", zend_memory_usage(TRUE TSRMLS_CC));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
/* -1 is also "true" */
if (*threshold) {
#endif
ret = realloc(REAL_PTR(ptr), REAL_SIZE(new_size));
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
--*threshold;
} else if (*threshold == 0) {
ret = NULL;
STD_PHP_INI_ENTRY("mysqlnd.log_mask", "0", PHP_INI_ALL, OnUpdateLong, log_mask, zend_mysqlnd_globals, mysqlnd_globals)
STD_PHP_INI_ENTRY("mysqlnd.mempool_default_size","16000", PHP_INI_ALL, OnUpdateLong, mempool_default_size, zend_mysqlnd_globals, mysqlnd_globals)
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
STD_PHP_INI_ENTRY("mysqlnd.debug_emalloc_fail_threshold","-1", PHP_INI_SYSTEM, OnUpdateLong, debug_emalloc_fail_threshold, zend_mysqlnd_globals, mysqlnd_globals)
STD_PHP_INI_ENTRY("mysqlnd.debug_ecalloc_fail_threshold","-1", PHP_INI_SYSTEM, OnUpdateLong, debug_ecalloc_fail_threshold, zend_mysqlnd_globals, mysqlnd_globals)
STD_PHP_INI_ENTRY("mysqlnd.debug_erealloc_fail_threshold","-1", PHP_INI_SYSTEM, OnUpdateLong, debug_erealloc_fail_threshold, zend_mysqlnd_globals, mysqlnd_globals)
/* }}} */
-#if defined(PHP_DEBUG)
+#if PHP_DEBUG
/* {{{ PHP_RINIT_FUNCTION
*/
static PHP_RINIT_FUNCTION(mysqlnd)
{
-#if defined(PHP_DEBUG)
if (MYSQLND_G(debug)) {
MYSQLND_DEBUG *dbg = mysqlnd_debug_init(mysqlnd_debug_std_no_trace_funcs TSRMLS_CC);
if (!dbg) {
dbg->m->set_mode(dbg, MYSQLND_G(debug));
MYSQLND_G(dbg) = dbg;
}
-#endif
return SUCCESS;
}
/* }}} */
#endif
-#if defined(PHP_DEBUG)
+#if PHP_DEBUG
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
static PHP_RSHUTDOWN_FUNCTION(mysqlnd)
mysqlnd_functions,
PHP_MINIT(mysqlnd),
PHP_MSHUTDOWN(mysqlnd),
-#if defined(PHP_DEBUG)
+#if PHP_DEBUG
PHP_RINIT(mysqlnd),
#else
NULL,
#endif
-#ifdef PHP_DEBUG
+#if PHP_DEBUG
PHP_RSHUTDOWN(mysqlnd),
#else
NULL,