]> git.eshelyaron.com Git - emacs.git/commitdiff
Add diagnostics for using private heap on MS-Windows during dumping.
authorEli Zaretskii <eliz@gnu.org>
Thu, 29 May 2014 15:21:08 +0000 (18:21 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 29 May 2014 15:21:08 +0000 (18:21 +0300)
 src/w32heap.c (report_temacs_memory_usage): New function.
 src/unexw32.c (unexec) [ENABLE_CHECKING]: Call report_temacs_memory_usage.
 src/w32heap.h (report_temacs_memory_usage): Add prototype.

src/ChangeLog
src/unexw32.c
src/w32heap.c
src/w32heap.h

index 5189712d490deb2e5877bf8b21ec52e216a4d5c9..463f5750652896a957c07abf7e5310cb840df5f4 100644 (file)
@@ -1,3 +1,12 @@
+2014-05-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32heap.c (report_temacs_memory_usage): New function.
+
+       * unexw32.c (unexec) [ENABLE_CHECKING]: Call
+       report_temacs_memory_usage.
+
+       * w32heap.h (report_temacs_memory_usage): Add prototype.
+
 2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
 
        Don't substitute sigprocmask for pthread_sigmask (Bug#17561).
index 60b926b249926edd16317d56396d7da84553899d..7cbd95a46fedd24b648fc97e29c04b39857219bc 100644 (file)
@@ -728,6 +728,10 @@ unexec (const char *new_name, const char *old_name)
     abort ();
   strcpy (p, q);
 
+#ifdef ENABLE_CHECKING
+  report_temacs_memory_usage ();
+#endif
+
   /* Make sure that the output filename has the ".exe" extension...patch
      it up if not.  */
   p = out_filename + strlen (out_filename) - 4;
index 7cce7c503194dfa8f2933d06baf637d5adffbf49..be0979017478de9e0c724c8d650283c2cefbf021 100644 (file)
@@ -448,6 +448,19 @@ free_before_dump (void *ptr)
     }
 }
 
+#ifdef ENABLE_CHECKING
+void
+report_temacs_memory_usage (void)
+{
+  /* Emulate 'message', which writes to stderr in non-interactive
+     sessions.  */
+  fprintf (stderr,
+          "Dump memory usage: Heap: %" PRIu64 "  Large blocks(%lu): %" PRIu64 "\n",
+          (unsigned long long)committed, blocks_number,
+          (unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit));
+}
+#endif
+
 /* Emulate getpagesize. */
 int
 getpagesize (void)
index 84a26f958d08c126f075d39ef5ea743b5c36c021..18b6c85c2dec21e0e6ed4f6d744ea10c5c5b3b0f 100644 (file)
@@ -41,6 +41,7 @@ extern void *mmap_realloc (void **, size_t);
 extern void  mmap_free (void **);
 extern void *mmap_alloc (void **, size_t);
 
+extern void report_temacs_memory_usage (void);
 
 /* Emulation of Unix sbrk().  */
 extern void *sbrk (ptrdiff_t size);