@@ -84,6 +84,10 @@ static void zend_mm_panic(const char *message) __attribute__ ((noreturn));
84
84
static void zend_mm_panic (const char * message )
85
85
{
86
86
fprintf (stderr , "%s\n" , message );
87
+ /* See http://support.microsoft.com/kb/190351 */
88
+ #ifdef PHP_WIN32
89
+ fflush (stderr );
90
+ #endif
87
91
#if ZEND_DEBUG && defined(HAVE_KILL ) && defined(HAVE_GETPID )
88
92
kill (getpid (), SIGSEGV );
89
93
#endif
@@ -1031,11 +1035,19 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
1031
1035
1032
1036
if (zend_mm_low_bit (block_size ) != zend_mm_high_bit (block_size )) {
1033
1037
fprintf (stderr , "'block_size' must be a power of two\n" );
1038
+ /* See http://support.microsoft.com/kb/190351 */
1039
+ #ifdef PHP_WIN32
1040
+ fflush (stderr );
1041
+ #endif
1034
1042
exit (255 );
1035
1043
}
1036
1044
storage = handlers -> init (params );
1037
1045
if (!storage ) {
1038
1046
fprintf (stderr , "Cannot initialize zend_mm storage [%s]\n" , handlers -> name );
1047
+ /* See http://support.microsoft.com/kb/190351 */
1048
+ #ifdef PHP_WIN32
1049
+ fflush (stderr );
1050
+ #endif
1039
1051
exit (255 );
1040
1052
}
1041
1053
storage -> handlers = handlers ;
@@ -1118,9 +1130,17 @@ ZEND_API zend_mm_heap *zend_mm_startup(void)
1118
1130
if (!mem_handlers [i ].name ) {
1119
1131
fprintf (stderr , "Wrong or unsupported zend_mm storage type '%s'\n" , mem_type );
1120
1132
fprintf (stderr , " supported types:\n" );
1133
+ /* See http://support.microsoft.com/kb/190351 */
1134
+ #ifdef PHP_WIN32
1135
+ fflush (stderr );
1136
+ #endif
1121
1137
for (i = 0 ; mem_handlers [i ].name ; i ++ ) {
1122
1138
fprintf (stderr , " '%s'\n" , mem_handlers [i ].name );
1123
1139
}
1140
+ /* See http://support.microsoft.com/kb/190351 */
1141
+ #ifdef PHP_WIN32
1142
+ fflush (stderr );
1143
+ #endif
1124
1144
exit (255 );
1125
1145
}
1126
1146
}
@@ -1131,9 +1151,17 @@ ZEND_API zend_mm_heap *zend_mm_startup(void)
1131
1151
seg_size = zend_atoi (tmp , 0 );
1132
1152
if (zend_mm_low_bit (seg_size ) != zend_mm_high_bit (seg_size )) {
1133
1153
fprintf (stderr , "ZEND_MM_SEG_SIZE must be a power of two\n" );
1154
+ /* See http://support.microsoft.com/kb/190351 */
1155
+ #ifdef PHP_WIN32
1156
+ fflush (stderr );
1157
+ #endif
1134
1158
exit (255 );
1135
1159
} else if (seg_size < ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE ) {
1136
1160
fprintf (stderr , "ZEND_MM_SEG_SIZE is too small\n" );
1161
+ /* See http://support.microsoft.com/kb/190351 */
1162
+ #ifdef PHP_WIN32
1163
+ fflush (stderr );
1164
+ #endif
1137
1165
exit (255 );
1138
1166
}
1139
1167
} else {
@@ -1672,6 +1700,10 @@ static void zend_mm_safe_error(zend_mm_heap *heap,
1672
1700
size );
1673
1701
fprintf (stderr , " in %s on line %d\n" , error_filename , error_lineno );
1674
1702
}
1703
+ /* See http://support.microsoft.com/kb/190351 */
1704
+ #ifdef PHP_WIN32
1705
+ fflush (stderr );
1706
+ #endif
1675
1707
} zend_end_try ();
1676
1708
} else {
1677
1709
heap -> overflow = 2 ;
0 commit comments