summaryrefslogtreecommitdiff
path: root/src/w32heap.h
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-01-18 17:04:00 +0200
committerEli Zaretskii <eliz@gnu.org>2019-01-18 17:04:00 +0200
commit5e3b0f5239027a413775d375f04376a3c97d0bf9 (patch)
tree7d6e6dbe03a405a2bd7e527e39a12fbf0dd1aa64 /src/w32heap.h
parentf943409183559b0af0e89f52bf0a93f8431c2dcf (diff)
downloademacs-5e3b0f5239027a413775d375f04376a3c97d0bf9.tar.gz
emacs-5e3b0f5239027a413775d375f04376a3c97d0bf9.tar.bz2
emacs-5e3b0f5239027a413775d375f04376a3c97d0bf9.zip
Clean up memory allocation and unexec support on MS-Windows
* src/w32heap.c (report_temacs_memory_usage): Condition on !CANNOT_DUMP, in addition to ENABLE_CHECKING. (init_heap): Accept an argument, which tells us what heap allocation method to use. (DUMPED_HEAP_SIZE) [CANNOT_DUMP]: Define to a small value, as we don't use dumped_data[] in this case. * src/w32heap.h (init_heap): Adjust prototype. <using_dynamic_heap>: Remove declaration. * src/emacs.c (main) [WINDOWSNT]: Determine heap allocation method based on whether we are in temacs and whether unexec will be used to dump Emacs. Pass the heap allocation method to init_heap, which is now called after parsing the --temacs=METHOD option. * src/unexw32.c (unexec): Don't fiddle with using_dynamic_heap. <using_dynamic_heap>: Remove definition. * src/w32proc.c (malloc_before_init, realloc_before_init) (free_before_init): New functions, to catch memory allocation before heap allocation method is set up.
Diffstat (limited to 'src/w32heap.h')
-rw-r--r--src/w32heap.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/w32heap.h b/src/w32heap.h
index 6b9dca38a3b..13f7a6325b2 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -31,7 +31,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
extern unsigned char *get_data_start (void);
extern unsigned char *get_data_end (void);
extern size_t reserved_heap_size;
-extern BOOL using_dynamic_heap;
extern void *mmap_realloc (void **, size_t);
extern void mmap_free (void **);
@@ -43,7 +42,7 @@ extern void report_temacs_memory_usage (void);
extern void *sbrk (ptrdiff_t size);
/* Initialize heap structures for sbrk on startup. */
-extern void init_heap (void);
+extern void init_heap (bool);
/* ----------------------------------------------------------------- */
/* Useful routines for manipulating memory-mapped files. */