+ Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ See the end of the file for license conditions.
+
+
Building and Installing Emacs from the Repository
+Simply run 'make'. This should work if your files are freshly checked
+out from the repository, and if you have the proper tools installed.
+If it doesn't work, or if you have special build requirements, the
+following information may be helpful.
+
Building Emacs from the source-code repository requires some tools
that are not needed when building from a release. You will need:
- /* Heap management routines for GNU Emacs on the Microsoft Windows
- API. Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc.
+ /* Heap management routines for GNU Emacs on the Microsoft Windows API.
+ Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc.
-This file is part of GNU Emacs.
+ This file is part of GNU Emacs.
-GNU Emacs is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+ GNU Emacs is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ GNU Emacs is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+ You should have received a copy of the GNU General Public License
+ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/*
- Geoff Voelker (voelker@cs.washington.edu) 7-29-94
+ Geoff Voelker (voelker@cs.washington.edu) 7-29-94
*/
+/*
+ Heavily modified by Fabrice Popineau (fabrice.popineau@gmail.com) 28-02-2014
+*/
+
+/*
+ Memory allocation scheme for w32/w64:
+
+ - Buffers are mmap'ed using a very simple emulation of mmap/munmap
+ - During the temacs phase:
+ * we use a private heap declared to be stored into the `dumped_data'
+ * unfortunately, this heap cannot be made growable, so the size of
+ blocks it can allocate is limited to (0x80000 - pagesize)
+ * the blocks that are larger than this are allocated from the end
+ of the `dumped_data' array; there are not so many of them.
+ We use a very simple first-fit scheme to reuse those blocks.
+ * we check that the private heap does not cross the area used
+ by the bigger chunks.
+ - During the emacs phase:
+ * we create a private heap for new memory blocks
+ * we make sure that we never free a block that has been dumped.
+ Freeing a dumped block could work in principle, but may prove
+ unreliable if we distribute binaries of emacs.exe: MS does not
+ guarantee that the heap data structures are the same across all
+ versions of their OS, even though the API is available since XP. */
+
#include <config.h>
#include <stdio.h>
+#include <errno.h>
+#include <sys/mman.h>
#include "w32common.h"
#include "w32heap.h"
#include "lisp.h" /* for VALMASK */