emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] Start opportunistic GC timer at startup


From: Eli Zaretskii
Subject: Re: [PATCH 3/3] Start opportunistic GC timer at startup
Date: Wed, 18 Nov 2020 19:54:52 +0200

> From: Spencer Baugh <sbaugh@catern.com>
> Date: Tue, 17 Nov 2020 19:20:50 -0500
> Cc: Spencer Baugh <sbaugh@catern.com>

Thanks, a few comments regarding style and coding conventions:

> +(defcustom gc-opportunistic-eager-factor 2
> +  "How eager we should be when GCing while Emacs is idle.
> +Emacs will call garbage-collect-maybe with this argument to
> +eagerly GC after gc-estimated-time idle seconds have passed.
> +If this is nil, we won't perform GC while Emacs is idle.

This doesn't say that the value should be either nil or a positive
number, a float.  Also, please avoid saying 'we" in documentation and
comments.  Finally, referebces to other functions and variables should
be quoted `like this', so they are converted into hyperlinks.

> +  :type 'integer)

Please always include a :version tag when you add new defcustoms.

> +(defvar gc-next-opportunistic-timer nil
> +  "The timer for the next opportunistic GC
                                            ^
Period missing at end of sentence.

> +(defun gc-start-opportunistic ()
> +  "Start a timer to GC after `gc-estimated-time' idle seconds.
> +The GC is performed with `garbage-collect-maybe', and is passed
> +`gc-opportunistic-eager-factor' as its single argument.
> +If `gc-opportunistic-eager-factor' is nil, we won't do anything.
> +This function is itself run by an idle timer at Emacs startup."

There's no need to explain the function's algorithm in a doc string,
that's what comments are for.  The doc string should explain what the
function does (not how it does that), and how to use it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]