From d756e1db2324c1f4ab6f9b52e329959ce6a02bc3 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 22 Dec 2003 13:08:04 +0000 Subject: add win32 configure option for CLI to switch on CRT heap debugging --- sapi/cli/php_cli.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sapi/cli/php_cli.c') 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) -- cgit v1.2.1