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.
This commit is contained in:
Eli Zaretskii 2014-05-29 18:21:08 +03:00
parent 035159ed54
commit d2ff520ae4
4 changed files with 27 additions and 0 deletions

View 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).

View 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;

View 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)

View 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);