* doc/README.win32: Replace ".exe.log" to ".gc.log".
* doc/README.win64: Ditto.
* doc/README.win64: Fix a typo.
* misc.c (GC_CreateLogFile): Strip executable file extension for
the log file; use ".gc.log" extension (instead of ".log").
2009-10-07 Ivan Maidanski <ivmai@mail.ru>
+ * doc/README.win32: Replace ".exe.log" to ".gc.log".
+ * doc/README.win64: Ditto.
+ * doc/README.win64: Fix a typo.
+ * misc.c (GC_CreateLogFile): Strip executable file extension for
+ the log file; use ".gc.log" extension (instead of ".log").
+
+2009-10-07 Ivan Maidanski <ivmai@mail.ru>
+
* include/gc_config_macros.h: Avoid the redefinition of
GC_xxx_THREADS macros.
For historical reasons,
the collector test program "gctest" is linked as a GUI application,
but does not open any windows. Its output normally appears in the file
-"gctest.exe.log". It may be started from the file manager. The hour glass
+"gctest.gc.log". It may be started from the file manager. The hour glass
cursor may appear as long as it's running. If it is started from the
command line, it will usually run in the background. Wait a few
minutes (a few seconds on a modern machine) before you check the output.
NT_X64_STATIC_THREADS_MAKEFILE has been used in
this environment. Copy this file to MAKEFILE, and then type "nmake"
in a Visual C++ command line window to build the static library
-and the usual test programs. To verify that the colllector is
+and the usual test programs. To verify that the collector is
at least somewhat functional, run gctest.exe. This should create
-gctest.exe.log after a few seconds.
+gctest.gc.log after a few seconds.
This process is completely analogous to NT_STATIC_THREADS_MAKEFILE
for the 32-bit version.
STATIC HANDLE GC_CreateLogFile(void)
{
# if !defined(NO_GETENV) || !defined(OLD_WIN32_LOG_FILE)
- TCHAR logPath[_MAX_PATH + sizeof(".log")];
+ TCHAR logPath[_MAX_PATH + 0x10]; /* buffer for path + ext */
# endif
/* Use GetEnvironmentVariable instead of GETENV() for unicode support. */
# ifndef NO_GETENV
NULL /* lpSecurityAttributes */, CREATE_ALWAYS,
FILE_FLAG_WRITE_THROUGH, NULL /* hTemplateFile */);
# else
+ int len = (int)GetModuleFileName(NULL /* hModule */, logPath,
+ _MAX_PATH + 1);
+ /* If GetModuleFileName() has failed then len is 0. */
+ if (len > 4 && logPath[len - 4] == (TCHAR)'.') {
+ len -= 4; /* strip executable file extension */
+ }
/* strcat/wcscat() are deprecated on WinCE, so use memcpy() */
- memcpy(&logPath[GetModuleFileName(NULL /* hModule */, logPath,
- _MAX_PATH + 1)],
- TEXT(".log"), sizeof(TEXT(".log")));
+ memcpy(&logPath[len], TEXT(".gc.log"), sizeof(TEXT(".gc.log")));
# endif
}
# if !defined(NO_GETENV) || !defined(OLD_WIN32_LOG_FILE)