diff options
author | Wez Furlong <wez@php.net> | 2003-12-22 13:08:04 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-12-22 13:08:04 +0000 |
commit | d756e1db2324c1f4ab6f9b52e329959ce6a02bc3 (patch) | |
tree | 0f37f5d1f50937571a278c1120c477c8a8d06739 /sapi/cli/php_cli.c | |
parent | 85735c23c6161fadcea2edf82c17c328bdb5533f (diff) | |
download | php-git-d756e1db2324c1f4ab6f9b52e329959ce6a02bc3.tar.gz |
add win32 configure option for CLI to switch on CRT heap debugging
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 306e143f2c..420e355b43 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -537,6 +537,20 @@ int main(int argc, char *argv[]) void ***tsrm_ls; #endif +#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP) + { + int tmp_flag; + + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + + tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); + tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF; + tmp_flag |= _CRTDBG_LEAK_CHECK_DF; + + _CrtSetDbgFlag(tmp_flag); + } +#endif #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) |