all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Don't use mark_vectorlike for bool vectors
@ 2007-10-05  9:56 Dmitry Antipov
  2007-10-05 13:18 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Antipov @ 2007-10-05  9:56 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

This cleanup patch avoids using mark_vectorlike for bool vectors,
since this kind of vectors doesn't contains Lisp objects to trace
during GC.

Dmitry

[-- Attachment #2: vector_mark.patch --]
[-- Type: text/x-patch, Size: 1462 bytes --]

Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.5912
diff -u -r1.5912 ChangeLog
--- ChangeLog	4 Oct 2007 16:57:53 -0000	1.5912
+++ ChangeLog	5 Oct 2007 09:58:11 -0000
@@ -1,3 +1,8 @@
+2007-10-05  Dmitry Antipov <dmantipov@yandex.ru>
+
+	* alloc.c (mark_object): Don't use mark_vectorlike for bool
+	vectors, reorganize vector marking code.
+	
 2007-10-04  Juanma Barranquero  <lekktu@gmail.com>
 
 	* image.c (syms_of_image) <image-types>: Fix typo in docstring.
Index: alloc.c
===================================================================
RCS file: /sources/emacs/emacs/src/alloc.c,v
retrieving revision 1.426
diff -u -r1.426 alloc.c
--- alloc.c	2 Oct 2007 22:07:41 -0000	1.426
+++ alloc.c	5 Oct 2007 09:58:11 -0000
@@ -5553,8 +5553,6 @@
 	      mark_buffer (obj);
 	    }
 	}
-      else if (GC_SUBRP (obj))
-	break;
       else if (GC_COMPILEDP (obj))
 	/* We could treat this just like a vector, but it is better to
 	   save the COMPILED_CONSTANTS element for last and avoid
@@ -5619,7 +5617,11 @@
 		VECTOR_MARK (XVECTOR (h->key_and_value));
 	    }
 	}
-      else
+      else if (GC_BOOL_VECTOR_P (obj))
+	/* Since no Lisp_Objects are referenced from bool vector,
+	   just mark the vector without examining it's contents.  */
+	VECTOR_MARK (XVECTOR (obj));
+      else if (!GC_SUBRP (obj))
 	mark_vectorlike (XVECTOR (obj));
       break;
 

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Don't use mark_vectorlike for bool vectors
  2007-10-05  9:56 Don't use mark_vectorlike for bool vectors Dmitry Antipov
@ 2007-10-05 13:18 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2007-10-05 13:18 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: emacs-devel

> This cleanup patch avoids using mark_vectorlike for bool vectors,
> since this kind of vectors doesn't contains Lisp objects to trace
> during GC.

Since their ->size field is set to 0, this should already work correctly,
doesn't it?


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-05 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-05  9:56 Don't use mark_vectorlike for bool vectors Dmitry Antipov
2007-10-05 13:18 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.