aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorPaul Eggert2016-10-23 21:54:13 -0700
committerPaul Eggert2016-10-23 21:55:07 -0700
commit7bb5c4f206bfbe46b5f4a376633437f8999d956a (patch)
treea98e0c598786246287995b6b1cf6c7882a253efb /src/gmalloc.c
parentee04aedc723b035eedaf975422d4eb242894121b (diff)
downloademacs-7bb5c4f206bfbe46b5f4a376633437f8999d956a.tar.gz
emacs-7bb5c4f206bfbe46b5f4a376633437f8999d956a.zip
Port --enable-gcc-warnings to bleeding-edge glibc
Bleeding-edge glibc sets emacs_cv_var_doug_lea_malloc to 'no'. Do not merge to master. * configure.ac: Check for valloc decl when compiling gmalloc.c. * src/gmalloc.c (emacs_abort) [emacs]: Adjust decl to match what is in lisp.h. Remove duplicate decl. (aligned_alloc): #undef before defining. (aligned_alloc, memalign) [!MSDOS]: Declare. (valloc) [HAVE_DECL_VALLOC]: Remove duplicate decl.
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index d2762d74e53..fb2861c18ac 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -40,7 +40,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
40#endif 40#endif
41 41
42#ifdef emacs 42#ifdef emacs
43extern void emacs_abort (void); 43extern _Noreturn void emacs_abort (void) NO_INLINE;
44#endif 44#endif
45 45
46/* If HYBRID_MALLOC is defined, then temacs will use malloc, 46/* If HYBRID_MALLOC is defined, then temacs will use malloc,
@@ -59,6 +59,7 @@ extern void emacs_abort (void);
59#undef malloc 59#undef malloc
60#undef realloc 60#undef realloc
61#undef calloc 61#undef calloc
62#undef aligned_alloc
62#undef free 63#undef free
63#define malloc gmalloc 64#define malloc gmalloc
64#define realloc grealloc 65#define realloc grealloc
@@ -95,9 +96,9 @@ extern void *calloc (size_t nmemb, size_t size) ATTRIBUTE_MALLOC_SIZE ((1,2));
95extern void free (void *ptr); 96extern void free (void *ptr);
96 97
97/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ 98/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
98#ifdef MSDOS
99extern void *aligned_alloc (size_t, size_t); 99extern void *aligned_alloc (size_t, size_t);
100extern void *memalign (size_t, size_t); 100extern void *memalign (size_t, size_t);
101#ifdef MSDOS
101extern int posix_memalign (void **, size_t, size_t); 102extern int posix_memalign (void **, size_t, size_t);
102#endif 103#endif
103 104
@@ -106,10 +107,6 @@ extern int posix_memalign (void **, size_t, size_t);
106extern void malloc_enable_thread (void); 107extern void malloc_enable_thread (void);
107#endif 108#endif
108 109
109#ifdef emacs
110extern void emacs_abort (void);
111#endif
112
113/* The allocator divides the heap into blocks of fixed size; large 110/* The allocator divides the heap into blocks of fixed size; large
114 requests receive one or more whole blocks, and small requests 111 requests receive one or more whole blocks, and small requests
115 receive a fragment of a block. Fragment sizes are powers of two, 112 receive a fragment of a block. Fragment sizes are powers of two,
@@ -1686,7 +1683,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
1686 or (US mail) as Mike Haertel c/o Free Software Foundation. */ 1683 or (US mail) as Mike Haertel c/o Free Software Foundation. */
1687 1684
1688/* Allocate SIZE bytes on a page boundary. */ 1685/* Allocate SIZE bytes on a page boundary. */
1686#ifndef HAVE_DECL_VALLOC
1689extern void *valloc (size_t); 1687extern void *valloc (size_t);
1688#endif
1690 1689
1691#if defined _SC_PAGESIZE || !defined HAVE_GETPAGESIZE 1690#if defined _SC_PAGESIZE || !defined HAVE_GETPAGESIZE
1692# include "getpagesize.h" 1691# include "getpagesize.h"
@@ -1769,7 +1768,7 @@ hybrid_aligned_alloc (size_t alignment, size_t size)
1769#endif 1768#endif
1770} 1769}
1771#endif 1770#endif
1772 1771
1773void * 1772void *
1774hybrid_realloc (void *ptr, size_t size) 1773hybrid_realloc (void *ptr, size_t size)
1775{ 1774{