com php-src: Fixes mem size format for error msg, fixes also Zend\tests\bug55509.phpt: Zend/zend_alloc.c Zend/zend_i nt.h
| From: | Anatol Belski | Date: | Mon, 04 Nov 2013 08:57:29 +0000 |
| Subject: | com php-src: Fixes mem size format for error msg, fixes also Zend\tests\bug55509.phpt: Zend/zend_alloc.c Zend/zend_i nt.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73847@lists.php.net to get a copy of this message | ||
Commit: 642a8b870a14f15a64d3200e832ecd56a0a35873
Author: Anatol Belski <ab@php.net> Mon, 4 Nov 2013 09:57:29 +0100
Parents: e243a26b4c0089eea2bce5577dfed80c01f335b9
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=642a8b870a14f15a64d3200e832ecd56a0a35873
Log:
Fixes mem size format for error msg, fixes also Zend\tests\bug55509.phpt
Bugs:
https://bugs.php.net/55509
Changed paths:
M Zend/zend_alloc.c
M Zend/zend_int.h
Diff:
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 71bc420..017e10a 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -1973,9 +1973,9 @@ static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size
ZEND_FILE_LINE_D
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
#if ZEND_DEBUG
- zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to
allocate %lu bytes)", heap->limit, __zend_filename, __zend_lineno, size);
+ zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted
at %s:%d (tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit,
__zend_filename, __zend_lineno, size);
#else
- zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %lu
bytes)", heap->limit, size);
+ zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted
(tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit, size);
#endif
}
@@ -2286,9 +2286,9 @@ realloc_segment:
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
#if ZEND_DEBUG
- zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to
allocate %ld bytes)", heap->limit, __zend_filename, __zend_lineno, size);
+ zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted
at %s:%d (tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit,
__zend_filename, __zend_lineno, size);
#else
- zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %ld
bytes)", heap->limit, size);
+ zend_mm_safe_error(heap, "Allowed memory size of " ZEND_INT_FMT " bytes exhausted
(tried to allocate " ZEND_UINT_FMT " bytes)", heap->limit, size);
#endif
return NULL;
}
diff --git a/Zend/zend_int.h b/Zend/zend_int.h
index b6ebd20..62121c3 100644
--- a/Zend/zend_int.h
+++ b/Zend/zend_int.h
@@ -52,6 +52,7 @@ typedef unsigned long zend_uint_t;
# define ZEND_ATOI(i, s) i = _atoi64((s))
# define ZEND_STRTOL(s0, s1, base) _strtoi64((s0), (s1), (base))
# define ZEND_INT_FMT "%I64d"
+# define ZEND_UINT_FMT "%I64u"
# else
# define ZEND_ITOA(i, s, len) \
do { \
@@ -61,6 +62,7 @@ typedef unsigned long zend_uint_t;
# define ZEND_ATOI(i, s) (i) = atoll((s))
# define ZEND_STRTOL(s0, s1, base) strtoll((s0), (s1), (base))
# define ZEND_INT_FMT "%lld"
+# define ZEND_UINT_FMT "%llu"
# endif
#else
# define ZEND_STRTOL(s0, s1, base) strtol((s0), (s1), (base))
@@ -76,6 +78,7 @@ typedef unsigned long zend_uint_t;
# define ZEND_ATOI(i, s) (i) = atol((s))
# endif
# define ZEND_INT_FMT "%ld"
+# define ZEND_UINT_FMT "%lu"
#endif