2009-10-07 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Wed, 7 Oct 2009 15:22:30 +0000 (15:22 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:49 +0000 (21:06 +0400)
* misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
CreateFile(); don't immediately flush every write if very verbose.

ChangeLog
misc.c

index eb5a59a..b14c709 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-10-07  Ivan Maidanski <ivmai@mail.ru>
 
+       * misc.c (GC_CreateLogFile): Use FILE_ATTRIBUTE_NORMAL for
+       CreateFile(); don't immediately flush every write if very verbose.
+
+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.
diff --git a/misc.c b/misc.c
index eab3e2d..27fcdd6 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -980,7 +980,10 @@ out:
 #   if !defined(NO_GETENV) || !defined(OLD_WIN32_LOG_FILE)
       return CreateFile(logPath, GENERIC_WRITE, FILE_SHARE_READ,
                         NULL /* lpSecurityAttributes */, CREATE_ALWAYS,
-                        FILE_FLAG_WRITE_THROUGH, NULL /* hTemplateFile */);
+                        GC_print_stats == VERBOSE ? FILE_ATTRIBUTE_NORMAL :
+                            /* immediately flush writes unless very verbose */
+                            FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH,
+                        NULL /* hTemplateFile */);
 #   endif
   }