summaryrefslogtreecommitdiff
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-12-29 21:39:08 -0800
committerJohn Wiegley <johnw@newartisans.com>2015-12-29 21:39:08 -0800
commitec0a80cc283badc7f7fd5ef78512dde6d34b1355 (patch)
tree7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /src/gmalloc.c
parentd259328fb87db8cc67d52771efcfa653e52c5b71 (diff)
parente823c34072bf045800d91e12c7ddb61fa23c6e30 (diff)
downloademacs-25-merge.tar.gz
Merge emacs-25 into master (using imerge)emacs-25-merge
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index a88f4ab75e0..90a52a1c728 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -60,7 +60,6 @@ extern void emacs_abort (void);
which HYBRID_MACRO is defined. Any other platform that wants to
define it will have to define the macros DUMPED and
ALLOCATED_BEFORE_DUMPING, defined below for Cygwin. */
-#ifdef HYBRID_MALLOC
#undef malloc
#undef realloc
#undef calloc
@@ -70,7 +69,6 @@ extern void emacs_abort (void);
#define calloc gcalloc
#define aligned_alloc galigned_alloc
#define free gfree
-#endif /* HYBRID_MALLOC */
#ifdef CYGWIN
extern void *bss_sbrk (ptrdiff_t size);
@@ -1711,13 +1709,13 @@ valloc (size_t size)
return aligned_alloc (pagesize, size);
}
-#ifdef HYBRID_MALLOC
#undef malloc
#undef realloc
#undef calloc
#undef aligned_alloc
#undef free
+#ifdef HYBRID_MALLOC
/* Declare system malloc and friends. */
extern void *malloc (size_t size);
extern void *realloc (void *ptr, size_t size);
@@ -1816,6 +1814,38 @@ hybrid_get_current_dir_name (void)
}
#endif
+#else /* ! HYBRID_MALLOC */
+
+void *
+malloc (size_t size)
+{
+ return gmalloc (size);
+}
+
+void *
+calloc (size_t nmemb, size_t size)
+{
+ return gcalloc (nmemb, size);
+}
+
+void
+free (void *ptr)
+{
+ gfree (ptr);
+}
+
+void *
+aligned_alloc (size_t alignment, size_t size)
+{
+ return galigned_alloc (alignment, size);
+}
+
+void *
+realloc (void *ptr, size_t size)
+{
+ return grealloc (ptr, size);
+}
+
#endif /* HYBRID_MALLOC */
#ifdef GC_MCHECK