Skip to content

Commit d8d8fd9

Browse files
committed
fix log alloc errors only once
1 parent 8b92113 commit d8d8fd9

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

Zend/zend_alloc.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,11 +1851,7 @@ static zend_mm_heap *zend_mm_init(void)
18511851

18521852
if (UNEXPECTED(chunk == NULL)) {
18531853
#if ZEND_MM_ERROR
1854-
#ifdef _WIN32
1855-
stderr_last_error("Can't initialize heap");
1856-
#else
1857-
fprintf(stderr, "\nCan't initialize heap: [%d] %s\n", errno, strerror(errno));
1858-
#endif
1854+
fprintf(stderr, "Can't initialize heap\n");
18591855
#endif
18601856
return NULL;
18611857
}
@@ -2982,11 +2978,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
29822978
chunk = (zend_mm_chunk*)handlers->chunk_alloc(&tmp_storage, ZEND_MM_CHUNK_SIZE, ZEND_MM_CHUNK_SIZE);
29832979
if (UNEXPECTED(chunk == NULL)) {
29842980
#if ZEND_MM_ERROR
2985-
#ifdef _WIN32
2986-
stderr_last_error("Can't initialize heap");
2987-
#else
2988-
fprintf(stderr, "\nCan't initialize heap: [%d] %s\n", errno, strerror(errno));
2989-
#endif
2981+
fprintf(stderr, "Can't initialize heap\n");
29902982
#endif
29912983
return NULL;
29922984
}
@@ -3029,11 +3021,7 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
30293021
if (!storage) {
30303022
handlers->chunk_free(&tmp_storage, chunk, ZEND_MM_CHUNK_SIZE);
30313023
#if ZEND_MM_ERROR
3032-
#ifdef _WIN32
3033-
stderr_last_error("Can't initialize heap");
3034-
#else
3035-
fprintf(stderr, "\nCan't initialize heap: [%d] %s\n", errno, strerror(errno));
3036-
#endif
3024+
fprintf(stderr, "Can't initialize heap\n");
30373025
#endif
30383026
return NULL;
30393027
}

0 commit comments

Comments
 (0)