Commit a7f999dc authored by Eli Zaretskii's avatar Eli Zaretskii

Improve dumped memory report on MS-Windows.

 src/w32heap.c (report_temacs_memory_usage): Improve the report by
 reporting the large blocks that are actually occupied at dump time.
parent 5dff48b0
2014-06-04 Eli Zaretskii <eliz@gnu.org>
* w32heap.c (report_temacs_memory_usage): Improve the report by
reporting the large blocks that are actually occupied at dump
time.
* w32console.c (initialize_w32_display): Set the console
menu_show_hook, otherwise TTY menus are broken on w32.
......
......@@ -479,7 +479,7 @@ free_before_dump (void *ptr)
/* Look for the big chunk. */
int i;
for(i = 0; i < blocks_number; i++)
for (i = 0; i < blocks_number; i++)
{
if (blocks[i].address == ptr)
{
......@@ -498,11 +498,22 @@ free_before_dump (void *ptr)
void
report_temacs_memory_usage (void)
{
DWORD blocks_used = 0, large_mem_used = 0;
int i;
for (i = 0; i < blocks_number; i++)
if (blocks[i].occupied)
{
blocks_used++;
large_mem_used += blocks[i].size;
}
/* 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,
"Dump memory usage: Heap: %" PRIu64 " Large blocks(%lu/%lu): %" PRIu64 "/%" PRIu64 "\n",
(unsigned long long)committed, blocks_used, blocks_number,
(unsigned long long)large_mem_used,
(unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit));
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment