From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Identifying sources of allocations in a toy Mandelbrot package Date: Sat, 20 Jan 2024 09:29:14 +0200 Message-ID: <834jf8v4xh.fsf@gnu.org> References: <87v87ps5gn.fsf@neko.mail-host-address-is-not-set> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25878"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 20 08:30:12 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1rR5nw-0006Uw-H6 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 20 Jan 2024 08:30:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rR5nL-0007LS-PT; Sat, 20 Jan 2024 02:29:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rR5nJ-0007L3-VI for help-gnu-emacs@gnu.org; Sat, 20 Jan 2024 02:29:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rR5nJ-0002oB-Mi for help-gnu-emacs@gnu.org; Sat, 20 Jan 2024 02:29:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=a4ceJZHROn7VCosFdAO/G3rVlxqJH2rQML+nC7jMXKI=; b=gKkR4x/QgAl7 I14kPkzXyeW3zXumOB8vJxzwSscdvJcaSemjbRnJFFtIxK0U6/H25OsxeItGdaGrSuKCI683m+0Sj Cr121tFVsAvHezzP5OAN1F7XEKDCju46Uu28OAJ7BOvdyCOKmsmd27WMnKnl/6FtZEVDVo0g+vr0n DfCrOY65xPgPP63bkeTRlLVI9/GBPSEc4srGHTI27n4HklEBjWTQr9Nhj5QSakTNFRoD70RYyyYiC 0BoSnX2t37OZXykmM1JCBy11VueToJo9lnHQDVCRWVxqnbqrdeSKZpGOcGCwCoaoVozod9W3i2nyw SnzO/07pqtm5xd4wCie89Q==; In-Reply-To: (message from Psionic K on Sat, 20 Jan 2024 12:14:53 +0900) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145759 Archived-At: > From: Psionic K > Date: Sat, 20 Jan 2024 12:14:53 +0900 > Cc: Psionic K , help-gnu-emacs@gnu.org, incal@dataswamp.org, > Eli Zaretskii > > > Any temporary Lisp objects will allocate memory. Their references will be on the stack, but the > objects themselves will be on the heap. > > I had presumed at a minimum that the compiler can re-use heap locations when it decides there's no > risk. While the values will be in the heap, is there a way to destructively re-use heap locations so that > we are not burning through all of the heap during iteration? Do function calls re-use any heap space? > Does anything besides GC? As it is, I can guess that every call to even + or * is creating a unique > float that now exists on the heap until GC'd. Yes, every temporary Lisp object other than an integere smaller than most-positive-fixnum gets allocated from the heap. I don't know enough about the native compiler and the optimizations it performs to tell whether the native code changes that in any way, but I would be surprised if it did.