[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] pdumper 233c3bb: Simplify dump_discard_mem conditional
From: |
Daniel Colascione |
Subject: |
[Emacs-diffs] pdumper 233c3bb: Simplify dump_discard_mem conditional |
Date: |
Wed, 14 Feb 2018 14:30:47 -0500 (EST) |
branch: pdumper
commit 233c3bbeaaa9a9f463d95c98884b6efefbad8fe5
Author: Daniel Colascione <address@hidden>
Commit: Daniel Colascione <address@hidden>
Simplify dump_discard_mem conditional
---
src/pdumper.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/pdumper.c b/src/pdumper.c
index a36ec3a..0df41cb 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -4256,26 +4256,18 @@ struct dump_memory_map {
static void
dump_discard_mem (void *mem, size_t size)
{
- if (VM_SUPPORTED == VM_MS_WINDOWS)
- {
#if VM_SUPPORTED == VM_MS_WINDOWS
/* Discard COWed pages. */
(void) VirtualFree (mem, size, MEM_DECOMMIT);
/* Release the commit charge for the mapping. */
(void) VirtualProtect (mem, size, PAGE_NOACCESS, NULL);
-#endif
- }
- else if (VM_SUPPORTED == VM_POSIX)
- {
-#ifdef HAVE_POSIX_MADVISE
+#elif VM_SUPPORTED == VM_POSIX
+# ifdef HAVE_POSIX_MADVISE
/* Discard COWed pages. */
(void) posix_madvise (mem, size, POSIX_MADV_DONTNEED);
-#endif
- /* Release the commit charge for the mapping. */
+# endif
(void) mprotect (mem, size, PROT_NONE);
- }
- else
- /* Do nothing */;
+#endif
}
static void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] pdumper 233c3bb: Simplify dump_discard_mem conditional,
Daniel Colascione <=