changeset 53650:5558449888ec

(lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]: Don't check range of malloc address. (pure_alloc) [USE_LSB_TAG]: Enforce alignment.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 21 Jan 2004 03:34:32 +0000
parents 87277b14c615
children c7d570b7ba42
files src/alloc.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Wed Jan 21 03:26:30 2004 +0000
+++ b/src/alloc.c	Wed Jan 21 03:34:32 2004 +0000
@@ -598,6 +598,7 @@
 
   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 @@
 	  val = 0;
 	}
     }
+#endif
 
 #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
   if (val && type != MEM_TYPE_NON_LISP)
@@ -772,6 +774,7 @@
       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 @@
 	      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 @@
      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 @@
       alignment = sizeof (struct Lisp_Float);
 #endif
     }
+#endif
 
  again:
   result = ALIGN (purebeg + pure_bytes_used, alignment);