aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorStephen Berman2013-06-14 22:07:55 +0200
committerStephen Berman2013-06-14 22:07:55 +0200
commitbd358779861f265a7acff31ead40172735af693e (patch)
tree345217a9889dbd29b09bdc80a94265c17719d41f /src/gmalloc.c
parent2a97b47f0878cbda86cb6ba0e7e744924810b70e (diff)
parentf7394b12358ae453a0c8b85fc307afc1b740010d (diff)
downloademacs-bd358779861f265a7acff31ead40172735af693e.tar.gz
emacs-bd358779861f265a7acff31ead40172735af693e.zip
Merge from trunk.
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c56
1 files changed, 18 insertions, 38 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 78d6934755b..bc1d85ac5fb 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1,6 +1,6 @@
1/* Declarations for `malloc' and friends. 1/* Declarations for `malloc' and friends.
2 Copyright (C) 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2002, 2003, 2004, 2 Copyright (C) 1990-1993, 1995-1996, 1999, 2002-2007, 2013 Free
3 2005, 2006, 2007 Free Software Foundation, Inc. 3 Software Foundation, Inc.
4 Written May 1989 by Mike Haertel. 4 Written May 1989 by Mike Haertel.
5 5
6This library is free software; you can redistribute it and/or 6This library is free software; you can redistribute it and/or
@@ -14,9 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details. 14General Public License for more details.
15 15
16You should have received a copy of the GNU General Public 16You should have received a copy of the GNU General Public
17License along with this library; see the file COPYING. If 17License along with this library. If not, see <http://www.gnu.org/licenses/>.
18not, write to the Free Software Foundation, Inc., 51 Franklin Street,
19Fifth Floor, Boston, MA 02110-1301, USA.
20 18
21 The author may be reached (Email) at the address mike@ai.mit.edu, 19 The author may be reached (Email) at the address mike@ai.mit.edu,
22 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 20 or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -36,6 +34,10 @@ Fifth Floor, Boston, MA 02110-1301, USA.
36#include <pthread.h> 34#include <pthread.h>
37#endif 35#endif
38 36
37#ifdef WINDOWSNT
38#include <w32heap.h> /* for sbrk */
39#endif
40
39#ifdef __cplusplus 41#ifdef __cplusplus
40extern "C" 42extern "C"
41{ 43{
@@ -288,9 +290,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
288General Public License for more details. 290General Public License for more details.
289 291
290You should have received a copy of the GNU General Public 292You should have received a copy of the GNU General Public
291License along with this library; see the file COPYING. If 293License along with this library. If not, see <http://www.gnu.org/licenses/>.
292not, write to the Free Software Foundation, Inc., 51 Franklin Street,
293Fifth Floor, Boston, MA 02110-1301, USA.
294 294
295 The author may be reached (Email) at the address mike@ai.mit.edu, 295 The author may be reached (Email) at the address mike@ai.mit.edu,
296 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 296 or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -460,7 +460,7 @@ get_contiguous_space (ptrdiff_t size, void *position)
460/* This is called when `_heapinfo' and `heapsize' have just 460/* This is called when `_heapinfo' and `heapsize' have just
461 been set to describe a new info table. Set up the table 461 been set to describe a new info table. Set up the table
462 to describe itself and account for it in the statistics. */ 462 to describe itself and account for it in the statistics. */
463static inline void 463static void
464register_heapinfo (void) 464register_heapinfo (void)
465{ 465{
466 size_t block, blocks; 466 size_t block, blocks;
@@ -968,9 +968,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
968General Public License for more details. 968General Public License for more details.
969 969
970You should have received a copy of the GNU General Public 970You should have received a copy of the GNU General Public
971License along with this library; see the file COPYING. If 971License along with this library. If not, see <http://www.gnu.org/licenses/>.
972not, write to the Free Software Foundation, Inc., 51 Franklin Street,
973Fifth Floor, Boston, MA 02110-1301, USA.
974 972
975 The author may be reached (Email) at the address mike@ai.mit.edu, 973 The author may be reached (Email) at the address mike@ai.mit.edu,
976 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 974 or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1282,14 +1280,14 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1282General Public License for more details. 1280General Public License for more details.
1283 1281
1284You should have received a copy of the GNU General Public 1282You should have received a copy of the GNU General Public
1285License along with this library; see the file COPYING. If 1283License along with this library. If not, see <http://www.gnu.org/licenses/>.
1286not, write to the Free Software Foundation, Inc., 51 Franklin Street,
1287Fifth Floor, Boston, MA 02110-1301, USA.
1288 1284
1289 The author may be reached (Email) at the address mike@ai.mit.edu, 1285 The author may be reached (Email) at the address mike@ai.mit.edu,
1290 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 1286 or (US mail) as Mike Haertel c/o Free Software Foundation. */
1291 1287
1288#ifndef min
1292#define min(A, B) ((A) < (B) ? (A) : (B)) 1289#define min(A, B) ((A) < (B) ? (A) : (B))
1290#endif
1293 1291
1294/* On Cygwin the dumped emacs may try to realloc storage allocated in 1292/* On Cygwin the dumped emacs may try to realloc storage allocated in
1295 the static heap. We just malloc space in the new heap and copy the 1293 the static heap. We just malloc space in the new heap and copy the
@@ -1481,9 +1479,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1481General Public License for more details. 1479General Public License for more details.
1482 1480
1483You should have received a copy of the GNU General Public 1481You should have received a copy of the GNU General Public
1484License along with this library; see the file COPYING. If 1482License along with this library. If not, see <http://www.gnu.org/licenses/>.
1485not, write to the Free Software Foundation, Inc., 51 Franklin Street,
1486Fifth Floor, Boston, MA 02110-1301, USA.
1487 1483
1488 The author may be reached (Email) at the address mike@ai.mit.edu, 1484 The author may be reached (Email) at the address mike@ai.mit.edu,
1489 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 1485 or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1514,9 +1510,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1514GNU General Public License for more details. 1510GNU General Public License for more details.
1515 1511
1516You should have received a copy of the GNU General Public License 1512You should have received a copy of the GNU General Public License
1517along with the GNU C Library; see the file COPYING. If not, write to 1513along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */
1518the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
1519MA 02110-1301, USA. */
1520 1514
1521/* uClibc defines __GNU_LIBRARY__, but it is not completely 1515/* uClibc defines __GNU_LIBRARY__, but it is not completely
1522 compatible. */ 1516 compatible. */
@@ -1560,9 +1554,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1560General Public License for more details. 1554General Public License for more details.
1561 1555
1562You should have received a copy of the GNU General Public 1556You should have received a copy of the GNU General Public
1563License along with this library; see the file COPYING. If 1557License along with this library. If not, see <http://www.gnu.org/licenses/>. */
1564not, write to the Free Software Foundation, Inc., 51 Franklin Street,
1565Fifth Floor, Boston, MA 02110-1301, USA. */
1566 1558
1567void *(*__memalign_hook) (size_t size, size_t alignment); 1559void *(*__memalign_hook) (size_t size, size_t alignment);
1568 1560
@@ -1639,14 +1631,6 @@ memalign (size_t alignment, size_t size)
1639 return result; 1631 return result;
1640} 1632}
1641 1633
1642#ifndef ENOMEM
1643#define ENOMEM 12
1644#endif
1645
1646#ifndef EINVAL
1647#define EINVAL 22
1648#endif
1649
1650int 1634int
1651posix_memalign (void **memptr, size_t alignment, size_t size) 1635posix_memalign (void **memptr, size_t alignment, size_t size)
1652{ 1636{
@@ -1680,9 +1664,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1680General Public License for more details. 1664General Public License for more details.
1681 1665
1682You should have received a copy of the GNU General Public 1666You should have received a copy of the GNU General Public
1683License along with this library; see the file COPYING. If 1667License along with this library. If not, see <http://www.gnu.org/licenses/>.
1684not, write to the Free Software Foundation, Inc., 51 Franklin Street,
1685Fifth Floor, Boston, MA 02110-1301, USA.
1686 1668
1687 The author may be reached (Email) at the address mike@ai.mit.edu, 1669 The author may be reached (Email) at the address mike@ai.mit.edu,
1688 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 1670 or (US mail) as Mike Haertel c/o Free Software Foundation. */
@@ -1724,9 +1706,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1724General Public License for more details. 1706General Public License for more details.
1725 1707
1726You should have received a copy of the GNU General Public 1708You should have received a copy of the GNU General Public
1727License along with this library; see the file COPYING. If 1709License along with this library. If not, see <http://www.gnu.org/licenses/>.
1728not, write to the Free Software Foundation, Inc., 51 Franklin Street,
1729Fifth Floor, Boston, MA 02110-1301, USA.
1730 1710
1731 The author may be reached (Email) at the address mike@ai.mit.edu, 1711 The author may be reached (Email) at the address mike@ai.mit.edu,
1732 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 1712 or (US mail) as Mike Haertel c/o Free Software Foundation. */