aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-05-29 18:21:08 +0300
committerEli Zaretskii2014-05-29 18:21:08 +0300
commitd2ff520ae44eaa9c21bb5c5069ff393b0b99eb60 (patch)
tree6e8104c5dfe066d08d64388d88627b90b5fd7aca /src
parent035159ed54cf2e1abc0439fbb6e628c9223f8e5d (diff)
downloademacs-d2ff520ae44eaa9c21bb5c5069ff393b0b99eb60.tar.gz
emacs-d2ff520ae44eaa9c21bb5c5069ff393b0b99eb60.zip
Add diagnostics for using private heap on MS-Windows during dumping.
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/unexw32.c4
-rw-r--r--src/w32heap.c13
-rw-r--r--src/w32heap.h1
4 files changed, 27 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5189712d490..463f5750652 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12014-05-29 Eli Zaretskii <eliz@gnu.org>
2
3 * w32heap.c (report_temacs_memory_usage): New function.
4
5 * unexw32.c (unexec) [ENABLE_CHECKING]: Call
6 report_temacs_memory_usage.
7
8 * w32heap.h (report_temacs_memory_usage): Add prototype.
9
12014-05-29 Paul Eggert <eggert@cs.ucla.edu> 102014-05-29 Paul Eggert <eggert@cs.ucla.edu>
2 11
3 Don't substitute sigprocmask for pthread_sigmask (Bug#17561). 12 Don't substitute sigprocmask for pthread_sigmask (Bug#17561).
diff --git a/src/unexw32.c b/src/unexw32.c
index 60b926b2499..7cbd95a46fe 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -728,6 +728,10 @@ unexec (const char *new_name, const char *old_name)
728 abort (); 728 abort ();
729 strcpy (p, q); 729 strcpy (p, q);
730 730
731#ifdef ENABLE_CHECKING
732 report_temacs_memory_usage ();
733#endif
734
731 /* Make sure that the output filename has the ".exe" extension...patch 735 /* Make sure that the output filename has the ".exe" extension...patch
732 it up if not. */ 736 it up if not. */
733 p = out_filename + strlen (out_filename) - 4; 737 p = out_filename + strlen (out_filename) - 4;
diff --git a/src/w32heap.c b/src/w32heap.c
index 7cce7c50319..be097901747 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -448,6 +448,19 @@ free_before_dump (void *ptr)
448 } 448 }
449} 449}
450 450
451#ifdef ENABLE_CHECKING
452void
453report_temacs_memory_usage (void)
454{
455 /* Emulate 'message', which writes to stderr in non-interactive
456 sessions. */
457 fprintf (stderr,
458 "Dump memory usage: Heap: %" PRIu64 " Large blocks(%lu): %" PRIu64 "\n",
459 (unsigned long long)committed, blocks_number,
460 (unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit));
461}
462#endif
463
451/* Emulate getpagesize. */ 464/* Emulate getpagesize. */
452int 465int
453getpagesize (void) 466getpagesize (void)
diff --git a/src/w32heap.h b/src/w32heap.h
index 84a26f958d0..18b6c85c2de 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -41,6 +41,7 @@ extern void *mmap_realloc (void **, size_t);
41extern void mmap_free (void **); 41extern void mmap_free (void **);
42extern void *mmap_alloc (void **, size_t); 42extern void *mmap_alloc (void **, size_t);
43 43
44extern void report_temacs_memory_usage (void);
44 45
45/* Emulation of Unix sbrk(). */ 46/* Emulation of Unix sbrk(). */
46extern void *sbrk (ptrdiff_t size); 47extern void *sbrk (ptrdiff_t size);