From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Pseudovectors initialization Date: Wed, 27 Jun 2012 17:22:49 -0400 Message-ID: References: <4FE9643E.6080004@yandex.ru> <4FEB422C.7070803@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340832181 21360 80.91.229.3 (27 Jun 2012 21:23:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 21:23:01 +0000 (UTC) Cc: Dan Nicolaescu , Emacs development discussions To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 27 23:22:59 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SjzhQ-0004DX-Ew for ged-emacs-devel@m.gmane.org; Wed, 27 Jun 2012 23:22:56 +0200 Original-Received: from localhost ([::1]:60056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjzhQ-0002RA-3H for ged-emacs-devel@m.gmane.org; Wed, 27 Jun 2012 17:22:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjzhN-0002Qb-Gj for emacs-devel@gnu.org; Wed, 27 Jun 2012 17:22:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjzhL-0002in-Q7 for emacs-devel@gnu.org; Wed, 27 Jun 2012 17:22:53 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:51587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjzhL-0002i1-MG; Wed, 27 Jun 2012 17:22:51 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q5RLMnaP003909; Wed, 27 Jun 2012 17:22:49 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 39BD1AE505; Wed, 27 Jun 2012 17:22:49 -0400 (EDT) In-Reply-To: <4FEB422C.7070803@yandex.ru> (Dmitry Antipov's message of "Wed, 27 Jun 2012 21:26:04 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4263=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4263> : streams <775144> : uri <1151021> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151239 Archived-At: >> Is removing this, or removing anything that is set to Qnil safe? >> It might be from case to case, but it's not obvious... > It's verified to be safe for windows, frames, processes and terminals. > ALLOCATE_PSEUDOVECTOR evaluates how many Lisp_Objects are located > after vectorlike_header, and then calls allocate_pseudovector to > initialize all of them to Qnil. Next, allocate_{window,frame,process, > terminal} zeroes the rest. Thus, you need to initialize Lisp_Object > slot only if it should be non-nil and other slot only if it should > be non-zero. There's another exception: slots which are of type Lisp_Object but are not traced normally by the GC (i.e. are placed in the "non-Lisp" part of the pseudo-vector). They're rare, tho (maybe the buffer's undo-log is one of them). Stefan