all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Michael Welsh Duggan <md5i@md5i.com>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: Pseudovectors initialization
Date: Tue, 26 Jun 2012 17:07:36 +0400	[thread overview]
Message-ID: <4FE9B418.4000709@yandex.ru> (raw)
In-Reply-To: <87wr2utfpl.fsf@maru.md5i.com>

On 06/26/2012 04:33 PM, Michael Welsh Duggan wrote:

> Is it really safe to memset to zero that which should default to Qnil?

No, of course.

All pseudo-vector objects has tricky layout:

pseudo_vector {
   vectorlike_header;
   Lisp_Object A;       |
   ...                  | area visible by GC
   Lisp_Object Z;       |
   non_lisp_object a;      |
   ...                     | area invisible for GC
   non_lisp_object z;      |
};

Everything from area visible by GC is initialized to Qnil by
allocate_pseudovector, and ALLOCATE_PSEUDOVECTOR knows how to
evaluate this area's size. This patch zeroes just the rest,
i.e. area invisible for GC.

Dmitry



  reply	other threads:[~2012-06-26 13:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26  7:26 Pseudovectors initialization Dmitry Antipov
2012-06-26  9:17 ` John Wiegley
2012-06-26 11:02   ` Dmitry Antipov
2012-06-26 12:33 ` Michael Welsh Duggan
2012-06-26 13:07   ` Dmitry Antipov [this message]
2012-06-26 13:15 ` Stefan Monnier
2012-06-26 13:52 ` Nix
2012-06-27 17:04 ` Dan Nicolaescu
2012-06-27 17:26   ` Dmitry Antipov
2012-06-27 21:22     ` Stefan Monnier
2012-06-27 21:31       ` Andreas Schwab

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

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

  git send-email \
    --in-reply-to=4FE9B418.4000709@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=md5i@md5i.com \
    /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 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.