From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Pure space and overflow question Date: Fri, 21 Feb 2020 15:23:03 +0000 Message-ID: References: <83y2sxjam7.fsf@gnu.org> <83blpsjelc.fsf@gnu.org> <838skwja9u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="63218"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 21 16:24:01 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j5A9o-000GJw-Rt for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Feb 2020 16:24:00 +0100 Original-Received: from localhost ([::1]:59660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5A9n-00042F-UB for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Feb 2020 10:23:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34512) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5A90-0002nG-PO for emacs-devel@gnu.org; Fri, 21 Feb 2020 10:23:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5A8z-000697-CW for emacs-devel@gnu.org; Fri, 21 Feb 2020 10:23:10 -0500 Original-Received: from mx.sdf.org ([205.166.94.20]:55167) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j5A8x-00065i-0A; Fri, 21 Feb 2020 10:23:07 -0500 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 01LFN3TV024919 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 21 Feb 2020 15:23:03 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 01LFN3lN018480; Fri, 21 Feb 2020 15:23:03 GMT In-Reply-To: <838skwja9u.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 21 Feb 2020 16:16:29 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245015 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: emacs-devel@gnu.org >> Date: Fri, 21 Feb 2020 13:54:42 +0000 >> >> > That said, why does your configuration require more pure space than >> > any other on that same platform? >> >> Effectively in comp.c are allocate object that goes into pure space and >> all the code is under #ifdef HAVE_NATIVE_COMP. >> >> Also the constant objects present in every compilation unit can have a >> small overhead respect to the elc one. This is because they include the >> data used by the 'top_level_run' function. > > Do you really need the former to be pure, and to be dumped in general? > If so, why? > > I think with portable dumper in place, we should have a more > fine-grained distinction between the stuff that really needs to be > dumped, and stuff that just happens to be there due to code that runs > at loadup time. The latter should not be dumped, but instead should > be re-created anew in every Emacs session. In particular, stuff that > is needed for compilation should ideally not even be in memory until > the user wants to compile something. > > Am I missing something? No you are not, effectively immediate objects into 'top_level_run' don't have to stay necessarily into pure space because once the file is loaded and emacs is dumped 'top_level_run' has no reason to be execute ever again. In this sense is a very special function. I've added a special variable to impose that objects are emitted as 'impure' (never copied to pure space). Binding this to t while emitting the code for 'top_level_run' does the job. This is sufficient to stay in the current pure space size (at least for my current X configuration). I'll be pushing it when finished with the tests. Thanks Andrea -- akrl@sdf.org