Commit: ec012c1b75a46ebc9a685597d8bcd74c4c0fa0c4
Author: Andrey Hristov <and...@php.net> Wed, 19 Dec 2012 16:58:34
+0100
Parents: 2768315856be2c2df291b275b76d90fb6ef09414
ae9ba081c8c83db096e5f9ab6add73b6223663cc
Branches: PHP-5.5 master
Link:
http://git.php.net/?p=php-src.git;a=commitdiff;h=ec012c1b75a46ebc9a685597d8bcd74c4c0fa0c4
Log:
Merge branch 'PHP-5.4' into PHP-5.5
Conflicts:
ext/mysqlnd/mysqlnd_alloc.c
Changed paths:
MM ext/mysqlnd/mysqlnd_alloc.c
diff --cc ext/mysqlnd/mysqlnd_alloc.c
index e681d33,5883d66..6166b4e
--- a/ext/mysqlnd/mysqlnd_alloc.c
+++ b/ext/mysqlnd/mysqlnd_alloc.c
@@@ -81,11 -81,14 +81,14 @@@ void * _mysqlnd_emalloc(size_t size MYS
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_emalloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_emalloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -118,10 -121,13 +121,14 @@@ void * _mysqlnd_pemalloc(size_t size, z
#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_pemalloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d persistent=%u",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno, persistent);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -157,11 -163,14 +164,15 @@@ void * _mysqlnd_ecalloc(unsigned int nm
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_ecalloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -194,10 -203,13 +205,13 @@@ void * _mysqlnd_pecalloc(unsigned int n
#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_pecalloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d persistent=%u",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno, persistent);
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -234,11 -246,14 +248,15 @@@ void * _mysqlnd_erealloc(void *ptr, siz
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_erealloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_erealloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size,
new_size);
+ TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size,
new_size);
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -271,11 -286,14 +289,15 @@@ void * _mysqlnd_perealloc(void *ptr, si
#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_perealloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_perealloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr,
old_size, new_size, persistent);
+ TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u",
ptr, old_size, new_size, persistent);
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -307,11 -325,14 +329,15 @@@ void _mysqlnd_efree(void *ptr MYSQLND_M
{
size_t free_amount = 0;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
- char * fn = NULL;
- DBG_ENTER(mysqlnd_efree_name);
+ TRACE_ALLOC_ENTER(mysqlnd_efree_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p", ptr);
+ TRACE_ALLOC_INF_FMT("ptr=%p", ptr);
if (ptr) {
if (collect_memory_statistics) {
@@@ -334,11 -355,14 +360,15 @@@ void _mysqlnd_pefree(void *ptr, zend_bo
{
size_t free_amount = 0;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
- char * fn = NULL;
- DBG_ENTER(mysqlnd_pefree_name);
+ TRACE_ALLOC_ENTER(mysqlnd_pefree_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p persistent=%u", ptr, persistent);
+ TRACE_ALLOC_INF_FMT("ptr=%p persistent=%u", ptr, persistent);
if (ptr) {
if (collect_memory_statistics) {
@@@ -365,10 -388,13 +395,14 @@@ void * _mysqlnd_malloc(size_t size MYSQ
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_malloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_malloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_malloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -400,10 -426,13 +434,14 @@@ void * _mysqlnd_calloc(unsigned int nme
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_calloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_calloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_calloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -435,12 -464,15 +473,16 @@@ void * _mysqlnd_realloc(void *ptr, size
#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_realloc_fail_threshold);
#endif
- char * fn = NULL;
- DBG_ENTER(mysqlnd_realloc_name);
+ TRACE_ALLOC_ENTER(mysqlnd_realloc_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
- DBG_INF_FMT("before: %lu", zend_memory_usage(TRUE TSRMLS_CC));
+ TRACE_ALLOC_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
+ TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE TSRMLS_CC));
#if PHP_DEBUG
/* -1 is also "true" */
@@@ -470,11 -502,14 +512,15 @@@ void _mysqlnd_free(void *ptr MYSQLND_ME
{
size_t free_amount = 0;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
- char * fn = NULL;
- DBG_ENTER(mysqlnd_free_name);
+ TRACE_ALLOC_ENTER(mysqlnd_free_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p", ptr);
+ TRACE_ALLOC_INF_FMT("ptr=%p", ptr);
if (ptr) {
if (collect_memory_statistics) {
@@@ -501,13 -536,16 +547,17 @@@ char * _mysqlnd_pestrndup(const char *
{
char * ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
- char * fn = NULL;
- DBG_ENTER(mysqlnd_pestrndup_name);
+ TRACE_ALLOC_ENTER(mysqlnd_pestrndup_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
++
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p", ptr);
+ TRACE_ALLOC_INF_FMT("ptr=%p", ptr);
- ret = pemalloc(REAL_SIZE(length) + 1, persistent);
+ ret = (persistent) ? __zend_malloc(REAL_SIZE(length + 1)) :
_emalloc(REAL_SIZE(length + 1) ZEND_FILE_LINE_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
{
size_t l = length;
char * p = (char *) ptr;
@@@ -535,11 -573,14 +585,14 @@@ char * _mysqlnd_pestrdup(const char * c
smart_str tmp_str = {0, 0, 0};
const char * p = ptr;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
- char * fn = NULL;
- DBG_ENTER(mysqlnd_pestrdup_name);
+ TRACE_ALLOC_ENTER(mysqlnd_pestrdup_name);
- TRACE_ALLOC_INF_FMT("file=%-15s line=%4d",
- (fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR))? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ #if PHP_DEBUG
+ {
- char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR);
- DBG_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename,
__zend_lineno);
++ char * fn = strrchr(__zend_orig_filename, PHP_DIR_SEPARATOR);
++ TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn +
1:__zend_orig_filename, __zend_orig_lineno);
+ }
+ #endif
- DBG_INF_FMT("ptr=%p", ptr);
+ TRACE_ALLOC_INF_FMT("ptr=%p", ptr);
do {
smart_str_appendc(&tmp_str, *p);
} while (*p++);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php