From 831b476c5a3d04c772364aaecf981252f515297e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 21 Jan 2004 03:34:32 +0000 Subject: [PATCH] (lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]: Don't check range of malloc address. (pure_alloc) [USE_LSB_TAG]: Enforce alignment. --- src/alloc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/alloc.c b/src/alloc.c index 484478ac3dd..f69ad5f870e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -598,6 +598,7 @@ lisp_malloc (nbytes, type) val = (void *) malloc (nbytes); +#ifndef USE_LSB_TAG /* If the memory just allocated cannot be addressed thru a Lisp object's pointer, and it needs to be, that's equivalent to running out of memory. */ @@ -612,6 +613,7 @@ lisp_malloc (nbytes, type) val = 0; } } +#endif #if GC_MARK_STACK && !defined GC_MALLOC_CHECK if (val && type != MEM_TYPE_NON_LISP) @@ -772,6 +774,7 @@ lisp_align_malloc (nbytes, type) mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); #endif +#ifndef USE_LSB_TAG /* If the memory just allocated cannot be addressed thru a Lisp object's pointer, and it needs to be, that's equivalent to running out of memory. */ @@ -788,6 +791,7 @@ lisp_align_malloc (nbytes, type) memory_full (); } } +#endif /* Initialize the blocks and put them on the free list. Is `base' was not properly aligned, we can't use the last block. */ @@ -4076,6 +4080,9 @@ pure_alloc (size, type) int type; { POINTER_TYPE *result; +#ifdef USE_LSB_TAG + size_t alignment = (1 << GCTYPEBITS); +#else size_t alignment = sizeof (EMACS_INT); /* Give Lisp_Floats an extra alignment. */ @@ -4087,6 +4094,7 @@ pure_alloc (size, type) alignment = sizeof (struct Lisp_Float); #endif } +#endif again: result = ALIGN (purebeg + pure_bytes_used, alignment); -- 2.39.2