svn: /php/php-src/ branches/PHP_5_3/main/main.c branches/PHP_5_4/main/main.c trunk/main/main.c
| From: | Dmitry Stogov | Date: | Tue, 17 Jan 2012 09:30:12 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/main/main.c branches/PHP_5_4/main/main.c trunk/main/main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-67454@lists.php.net to get a copy of this message | ||
dmitry Tue, 17 Jan 2012 09:30:12 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=322384
Log:
Fixed workaround for bug #48034 on Windows (Crash when script is 8192 (8KB) bytes long)
Bug: https://bugs.php.net/48034 (Assigned) Crash when
script is 8192 (8KB) bytes long
Changed paths:
U php/php-src/branches/PHP_5_3/main/main.c
U php/php-src/branches/PHP_5_4/main/main.c
U php/php-src/trunk/main/main.c
Modified: php/php-src/branches/PHP_5_3/main/main.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/main.c 2012-01-17 08:29:44 UTC (rev 322383)
+++ php/php-src/branches/PHP_5_3/main/main.c 2012-01-17 09:30:12 UTC (rev 322384)
@@ -92,7 +92,7 @@
#include "SAPI.h"
#include "rfc1867.h"
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
@@ -1216,7 +1216,7 @@
php_stream *stream = php_stream_open_wrapper((char *)filename, "rb", mode,
&handle->opened_path);
if (stream) {
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
size_t page_size = REAL_PAGE_SIZE;
#endif
@@ -1230,7 +1230,7 @@
memset(&handle->handle.stream.mmap, 0, sizeof(handle->handle.stream.mmap));
len = php_zend_stream_fsizer(stream TSRMLS_CC);
if (len != 0
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
&& ((len - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD
#endif
&& php_stream_mmap_possible(stream)
Modified: php/php-src/branches/PHP_5_4/main/main.c
===================================================================
--- php/php-src/branches/PHP_5_4/main/main.c 2012-01-17 08:29:44 UTC (rev 322383)
+++ php/php-src/branches/PHP_5_4/main/main.c 2012-01-17 09:30:12 UTC (rev 322384)
@@ -93,7 +93,7 @@
#include "SAPI.h"
#include "rfc1867.h"
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
@@ -1303,7 +1303,7 @@
php_stream *stream = php_stream_open_wrapper((char *)filename, "rb", mode,
&handle->opened_path);
if (stream) {
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
size_t page_size = REAL_PAGE_SIZE;
#endif
@@ -1317,7 +1317,7 @@
memset(&handle->handle.stream.mmap, 0, sizeof(handle->handle.stream.mmap));
len = php_zend_stream_fsizer(stream TSRMLS_CC);
if (len != 0
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
&& ((len - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD
#endif
&& php_stream_mmap_possible(stream)
Modified: php/php-src/trunk/main/main.c
===================================================================
--- php/php-src/trunk/main/main.c 2012-01-17 08:29:44 UTC (rev 322383)
+++ php/php-src/trunk/main/main.c 2012-01-17 09:30:12 UTC (rev 322384)
@@ -93,7 +93,7 @@
#include "SAPI.h"
#include "rfc1867.h"
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
@@ -1303,7 +1303,7 @@
php_stream *stream = php_stream_open_wrapper((char *)filename, "rb", mode,
&handle->opened_path);
if (stream) {
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
size_t page_size = REAL_PAGE_SIZE;
#endif
@@ -1317,7 +1317,7 @@
memset(&handle->handle.stream.mmap, 0, sizeof(handle->handle.stream.mmap));
len = php_zend_stream_fsizer(stream TSRMLS_CC);
if (len != 0
-#if HAVE_MMAP
+#if HAVE_MMAP || defined(PHP_WIN32)
&& ((len - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD
#endif
&& php_stream_mmap_possible(stream)