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: [PATCH 2/3] Add garbage-collect-maybe function Date: Wed, 18 Nov 2020 19:49:47 +0200 Message-ID: <83lfeypnb8.fsf@gnu.org> References: <20201118002050.16426-1-sbaugh@catern.com> <20201118002050.16426-3-sbaugh@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27984"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@catern.com, emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 18 18:52:48 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 1kfRdP-0007AU-EH for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Nov 2020 18:52:47 +0100 Original-Received: from localhost ([::1]:48726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfRdO-0006aP-7S for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Nov 2020 12:52:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfRae-0004BH-Hr for emacs-devel@gnu.org; Wed, 18 Nov 2020 12:49:57 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58257) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfRac-0006GZ-Nk; Wed, 18 Nov 2020 12:49:55 -0500 Original-Received: from [176.228.60.248] (port=1883 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kfRaZ-000147-VK; Wed, 18 Nov 2020 12:49:54 -0500 In-Reply-To: <20201118002050.16426-3-sbaugh@catern.com> (message from Spencer Baugh on Tue, 17 Nov 2020 19:20:49 -0500) 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:259370 Archived-At: > From: Spencer Baugh > Date: Tue, 17 Nov 2020 19:20:49 -0500 > Cc: Spencer Baugh > Thanks, a few comments regarding style and coding conventions: > + if (factor >= 1 && since_gc > gc_threshold / factor) { > + garbage_collect (); > + return true; > + } else > + return false; Style of braces again. > +FACTOR determined what "enough" means here: ^^^^^^^^^^ "determines" > +a FACTOR of N means to run the GC if more than 1/Nth of the allocations > +needed to triger automatic allocation took place. "If FACTOR is a positive number N, it means to run GC ..." > +Returns t if we garbage collected, and nil otherwise. */) "Return t if GC happened, nil otherwise". (IOW, avoid the "we" part.) > + if (maybe_garbage_collect_eagerly(fact)) ^^ Please leave a blank between the name of the function and the opening brace.