changeset 10413:bfe591f66299

(DONT_COPY_FLAG): Default this to 1. (mark_object): Use the same XOR expression as elsewhere. (gc_sweep): Don't touch DONT_COPY_FLAG here; this one is a real size field, not a mangled pointer.
author Karl Heuer <kwzh@gnu.org>
date Fri, 13 Jan 1995 00:00:23 +0000
parents ff0b2d5848be
children f4a1838db0bf
files src/alloc.c
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Thu Jan 12 23:45:01 1995 +0000
+++ b/src/alloc.c	Fri Jan 13 00:00:23 1995 +0000
@@ -107,10 +107,15 @@
 #define MAX_SAVE_STACK 16000
 #endif
 
-/* Define DONT_COPY_FLAG to be the bit in a small string that was placed
-   in the low bit of the size field when marking small strings.  */
+/* Define DONT_COPY_FLAG to be some bit which will always be zero in a
+   pointer to a Lisp_Object, when that pointer is viewed as an integer.
+   (On most machines, pointers are even, so we can use the low bit.
+   Word-addressible architectures may need to override this in the m-file.)
+   When linking references to small strings through the size field, we
+   use this slot to hold the bit that would otherwise be interpreted as
+   the GC mark bit.  */
 #ifndef DONT_COPY_FLAG
-#define DONT_COPY_FLAG PSEUDOVECTOR_FLAG
+#define DONT_COPY_FLAG 1
 #endif /* no DONT_COPY_FLAG  */
 
 /* Buffer in which we save a copy of the C stack at each GC.  */
@@ -1509,8 +1514,7 @@
 	  {
 	    /* A small string.  Put this reference
 	       into the chain of references to it.
-	       The address OBJPTR is even, so if the address
-	       includes MARKBIT, put it in the low bit
+	       If the address includes MARKBIT, put that bit elsewhere
 	       when we store OBJPTR into the size field.  */
 
 	    if (XMARKBIT (*objptr))
@@ -1523,9 +1527,9 @@
 
 	    if ((EMACS_INT) objptr & DONT_COPY_FLAG)
 	      abort ();
-	    ptr->size = (EMACS_INT) objptr & ~MARKBIT;
-	    if ((EMACS_INT) objptr & MARKBIT)
-	      ptr->size |= DONT_COPY_FLAG;
+	    ptr->size = (EMACS_INT) objptr;
+	    if (ptr->size & MARKBIT)
+	      ptr->size ^= MARKBIT | DONT_COPY_FLAG;
 	  }
       }
       break;
@@ -2043,7 +2047,7 @@
 	if (s->size & ARRAY_MARK_FLAG)
 	  {
 	    ((struct Lisp_String *)(&sb->chars[0]))->size
-	      &= ~ARRAY_MARK_FLAG & ~MARKBIT & ~DONT_COPY_FLAG;
+	      &= ~ARRAY_MARK_FLAG & ~MARKBIT;
 	    UNMARK_BALANCE_INTERVALS (s->intervals);
 	    total_string_size += ((struct Lisp_String *)(&sb->chars[0]))->size;
 	    prev = sb, sb = sb->next;