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.devel Subject: Re: Lisp-level macro to avoid excessive GC in memory-allocating code Date: Fri, 01 Jul 2022 17:10:00 +0300 Message-ID: <83bku8exfr.fsf@gnu.org> References: <877d5mqmkh.fsf@localhost> <83y1y2utnd.fsf@gnu.org> <87r13up587.fsf@localhost> <83o7yyur0l.fsf@gnu.org> <87leu2p3nu.fsf@localhost> <83leu2uewn.fsf@gnu.org> <87r13qv701.fsf@localhost> <83bkuursya.fsf@gnu.org> <87h74l9jk8.fsf@localhost> <83bkutqb3z.fsf@gnu.org> <9778F176-E724-4E61-B0FB-327BCDD316C0@acm.org> <87sfo4epeo.fsf@localhost> <87bkurrc5e.fsf@localhost> <87v8shk1c5.fsf@localhost> <83wncxe4pr.fsf@gnu.org> <87k08xjmlm.fsf@localhost> <83r135dsbn.fsf@gnu.org> <877d4xjddm.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21019"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@gmail.com, mattiase@acm.org, theophilusx@gmail.com, rms@gnu.org, acm@muc.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 01 16:21:04 2022 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 1o7HW4-0005EW-8n for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Jul 2022 16:21:04 +0200 Original-Received: from localhost ([::1]:49874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7HW3-0004aG-AJ for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Jul 2022 10:21:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7HLE-0000AF-UN for emacs-devel@gnu.org; Fri, 01 Jul 2022 10:09:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7HLD-0005uM-Dc; Fri, 01 Jul 2022 10:09:51 -0400 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=lN5iT6gNSPojEkyva07biCphkw5AzEeDVH0h0MOFSQY=; b=EjMWwjWVMVBB 21qe0rzWHxNvUaOIhO1KInezlTAJ/3vKvpAqbAgc/LnvMyWxaoJjyZyyRBhE1+30zLNbzMDd5EWJH fGlb3/bVyqfTrxoSJu0jYMpQ0CQgchxnUchYcUYXM6CvJkQ1MtOM4yA1evSteLkJCvGX6RwkcOYog Iugd9XGMP1ePUaGiNlZS4fnEMAKtuPa9pOCRZG+GRdNlZqUPzFypajS0OxSrQBWckm7U2S8Wh5UJT l35GMDFo4qnr65n1VzUpIpfEm0Zer5Ay+2kLZpG0QERGsBbGqLof7JM1wA46Z4nef0VN0HBHKlwjG N5d6F45C/GZXIBO6RQw6sQ==; Original-Received: from [87.69.77.57] (port=1538 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7HLA-0001SV-Sh; Fri, 01 Jul 2022 10:09:50 -0400 In-Reply-To: (message from Stefan Monnier on Fri, 01 Jul 2022 09:56:52 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:291782 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , mattiase@acm.org, theophilusx@gmail.com, > rms@gnu.org, acm@muc.de, emacs-devel@gnu.org > Date: Fri, 01 Jul 2022 09:56:52 -0400 > > A simple `with-mostly-allocating-code` macro that increases > `gc-cons-percentage` to 1.0 sounds a lot simpler and won't impose any > extra burden on "normal" code. I agree, but if we are going to introduce such an implementation, I think we should make our handling of memory-full situation smarter. Like perhaps keep somewhat larger memory reserve, so that if we hit the memory limit, we could still call GC and continue, instead of signaling a fatal error.