unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: emacs-devel@gnu.org
Subject: Don't use mark_vectorlike for bool vectors
Date: Fri, 05 Oct 2007 13:56:04 +0400	[thread overview]
Message-ID: <47060A34.8020803@yandex.ru> (raw)

[-- 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

             reply	other threads:[~2007-10-05  9:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-05  9:56 Dmitry Antipov [this message]
2007-10-05 13:18 ` Don't use mark_vectorlike for bool vectors Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47060A34.8020803@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).