[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pseudovectors initialization

From: Dmitry Antipov
Subject: Re: Pseudovectors initialization
Date: Tue, 26 Jun 2012 17:07:36 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

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 {
  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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]