aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/alloc.c b/src/alloc.c
index eb2e9fae783..642cccc97c6 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -127,7 +127,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
127 marked objects. */ 127 marked objects. */
128 128
129#if (defined SYSTEM_MALLOC || defined DOUG_LEA_MALLOC \ 129#if (defined SYSTEM_MALLOC || defined DOUG_LEA_MALLOC \
130 || defined HYBRID_MALLOC || GC_CHECK_MARKED_OBJECTS) 130 || GC_CHECK_MARKED_OBJECTS)
131#undef GC_MALLOC_CHECK 131#undef GC_MALLOC_CHECK
132#endif 132#endif
133 133
@@ -460,7 +460,7 @@ static void gc_sweep (void);
460static Lisp_Object make_pure_vector (ptrdiff_t); 460static Lisp_Object make_pure_vector (ptrdiff_t);
461static void mark_buffer (struct buffer *); 461static void mark_buffer (struct buffer *);
462 462
463#if !defined REL_ALLOC || defined SYSTEM_MALLOC || defined HYBRID_MALLOC 463#if !defined REL_ALLOC || defined SYSTEM_MALLOC
464static void refill_memory_reserve (void); 464static void refill_memory_reserve (void);
465#endif 465#endif
466static void compact_small_strings (void); 466static void compact_small_strings (void);
@@ -644,7 +644,7 @@ struct Lisp_Finalizer doomed_finalizers;
644 Malloc 644 Malloc
645 ************************************************************************/ 645 ************************************************************************/
646 646
647#if defined SIGDANGER || (!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC) 647#if defined SIGDANGER || (!defined SYSTEM_MALLOC)
648 648
649/* Function malloc calls this if it finds we are near exhausting storage. */ 649/* Function malloc calls this if it finds we are near exhausting storage. */
650 650
@@ -1066,19 +1066,14 @@ lisp_free (void *block)
1066# define BLOCK_ALIGN (1 << 15) 1066# define BLOCK_ALIGN (1 << 15)
1067static_assert (POWER_OF_2 (BLOCK_ALIGN)); 1067static_assert (POWER_OF_2 (BLOCK_ALIGN));
1068 1068
1069/* Use aligned_alloc if it or a simple substitute is available. 1069/* Use aligned_alloc if it or a simple substitute is available. */
1070 Aligned allocation is incompatible with unexmacosx.c, so don't use 1070
1071 it on Darwin if HAVE_UNEXEC. */ 1071#if (defined HAVE_ALIGNED_ALLOC \
1072 1072 || (!defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC))
1073#if ! (defined DARWIN_OS && defined HAVE_UNEXEC) 1073# define USE_ALIGNED_ALLOC 1
1074# if (defined HAVE_ALIGNED_ALLOC \ 1074#elif defined HAVE_POSIX_MEMALIGN
1075 || (defined HYBRID_MALLOC \ 1075# define USE_ALIGNED_ALLOC 1
1076 ? defined HAVE_POSIX_MEMALIGN \ 1076# define aligned_alloc my_aligned_alloc /* Avoid collision with lisp.h. */
1077 : !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC))
1078# define USE_ALIGNED_ALLOC 1
1079# elif !defined HYBRID_MALLOC && defined HAVE_POSIX_MEMALIGN
1080# define USE_ALIGNED_ALLOC 1
1081# define aligned_alloc my_aligned_alloc /* Avoid collision with lisp.h. */
1082static void * 1077static void *
1083aligned_alloc (size_t alignment, size_t size) 1078aligned_alloc (size_t alignment, size_t size)
1084{ 1079{
@@ -1095,7 +1090,6 @@ aligned_alloc (size_t alignment, size_t size)
1095 void *p; 1090 void *p;
1096 return posix_memalign (&p, alignment, size) == 0 ? p : 0; 1091 return posix_memalign (&p, alignment, size) == 0 ? p : 0;
1097} 1092}
1098# endif
1099#endif 1093#endif
1100 1094
1101/* Padding to leave at the end of a malloc'd block. This is to give 1095/* Padding to leave at the end of a malloc'd block. This is to give
@@ -4433,7 +4427,7 @@ memory_full (size_t nbytes)
4433void 4427void
4434refill_memory_reserve (void) 4428refill_memory_reserve (void)
4435{ 4429{
4436#if !defined SYSTEM_MALLOC && !defined HYBRID_MALLOC 4430#if !defined SYSTEM_MALLOC
4437 if (spare_memory[0] == 0) 4431 if (spare_memory[0] == 0)
4438 spare_memory[0] = malloc (SPARE_MEMORY); 4432 spare_memory[0] = malloc (SPARE_MEMORY);
4439 if (spare_memory[1] == 0) 4433 if (spare_memory[1] == 0)