diff options
| author | Stephen Berman | 2013-06-14 22:07:55 +0200 |
|---|---|---|
| committer | Stephen Berman | 2013-06-14 22:07:55 +0200 |
| commit | bd358779861f265a7acff31ead40172735af693e (patch) | |
| tree | 345217a9889dbd29b09bdc80a94265c17719d41f /src/gmalloc.c | |
| parent | 2a97b47f0878cbda86cb6ba0e7e744924810b70e (diff) | |
| parent | f7394b12358ae453a0c8b85fc307afc1b740010d (diff) | |
| download | emacs-bd358779861f265a7acff31ead40172735af693e.tar.gz emacs-bd358779861f265a7acff31ead40172735af693e.zip | |
Merge from trunk.
Diffstat (limited to 'src/gmalloc.c')
| -rw-r--r-- | src/gmalloc.c | 56 |
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 | ||
| 6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
| @@ -14,9 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
| 14 | General Public License for more details. | 14 | General Public License for more details. |
| 15 | 15 | ||
| 16 | You should have received a copy of the GNU General Public | 16 | You should have received a copy of the GNU General Public |
| 17 | License along with this library; see the file COPYING. If | 17 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 18 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 19 | Fifth 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 |
| 40 | extern "C" | 42 | extern "C" |
| 41 | { | 43 | { |
| @@ -288,9 +290,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
| 288 | General Public License for more details. | 290 | General Public License for more details. |
| 289 | 291 | ||
| 290 | You should have received a copy of the GNU General Public | 292 | You should have received a copy of the GNU General Public |
| 291 | License along with this library; see the file COPYING. If | 293 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 292 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 293 | Fifth 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. */ |
| 463 | static inline void | 463 | static void |
| 464 | register_heapinfo (void) | 464 | register_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 | |||
| 968 | General Public License for more details. | 968 | General Public License for more details. |
| 969 | 969 | ||
| 970 | You should have received a copy of the GNU General Public | 970 | You should have received a copy of the GNU General Public |
| 971 | License along with this library; see the file COPYING. If | 971 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 972 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 973 | Fifth 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 | |||
| 1282 | General Public License for more details. | 1280 | General Public License for more details. |
| 1283 | 1281 | ||
| 1284 | You should have received a copy of the GNU General Public | 1282 | You should have received a copy of the GNU General Public |
| 1285 | License along with this library; see the file COPYING. If | 1283 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 1286 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 1287 | Fifth 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 | |||
| 1481 | General Public License for more details. | 1479 | General Public License for more details. |
| 1482 | 1480 | ||
| 1483 | You should have received a copy of the GNU General Public | 1481 | You should have received a copy of the GNU General Public |
| 1484 | License along with this library; see the file COPYING. If | 1482 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 1485 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 1486 | Fifth 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 | |||
| 1514 | GNU General Public License for more details. | 1510 | GNU General Public License for more details. |
| 1515 | 1511 | ||
| 1516 | You should have received a copy of the GNU General Public License | 1512 | You should have received a copy of the GNU General Public License |
| 1517 | along with the GNU C Library; see the file COPYING. If not, write to | 1513 | along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ |
| 1518 | the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, | ||
| 1519 | MA 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 | |||
| 1560 | General Public License for more details. | 1554 | General Public License for more details. |
| 1561 | 1555 | ||
| 1562 | You should have received a copy of the GNU General Public | 1556 | You should have received a copy of the GNU General Public |
| 1563 | License along with this library; see the file COPYING. If | 1557 | License along with this library. If not, see <http://www.gnu.org/licenses/>. */ |
| 1564 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 1565 | Fifth Floor, Boston, MA 02110-1301, USA. */ | ||
| 1566 | 1558 | ||
| 1567 | void *(*__memalign_hook) (size_t size, size_t alignment); | 1559 | void *(*__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 | |||
| 1650 | int | 1634 | int |
| 1651 | posix_memalign (void **memptr, size_t alignment, size_t size) | 1635 | posix_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 | |||
| 1680 | General Public License for more details. | 1664 | General Public License for more details. |
| 1681 | 1665 | ||
| 1682 | You should have received a copy of the GNU General Public | 1666 | You should have received a copy of the GNU General Public |
| 1683 | License along with this library; see the file COPYING. If | 1667 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 1684 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 1685 | Fifth 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 | |||
| 1724 | General Public License for more details. | 1706 | General Public License for more details. |
| 1725 | 1707 | ||
| 1726 | You should have received a copy of the GNU General Public | 1708 | You should have received a copy of the GNU General Public |
| 1727 | License along with this library; see the file COPYING. If | 1709 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 1728 | not, write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 1729 | Fifth 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. */ |