bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#39944: 27.0.90; JIT Stealth timer errors


From: Paul Eggert
Subject: bug#39944: 27.0.90; JIT Stealth timer errors
Date: Sun, 8 Mar 2020 00:41:05 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Although comments in that area no doubt could use improvement, I'd rather not see comments like this:

       /* Add TM_YEAR_BASE to mpz[0].  */
       mpz_add_ui (mpz[0], mpz[0], TM_YEAR_BASE);

There are quite a few of similar comments there,

I don't see any similar comments for simple calls from Emacs to mpz_add_ui. And I doubt whether there should be, any more than image.c should have comments like this:

  /* Use components from GC to draw a line on DPY's PIXMAP from (X, Y)
     to (X+WIDTH-1, Y+HEIGHT-1).  */
  XDrawLine (dpy, pixmap, gc, x, y, x + width - 1, y + height - 1);

Emacs does not do comments like that, because they would clutter the code if you already know what XDrawLine does; and if you don't know, it's easy enough to look it up - which you should do anyway, and you'll need to do it anyway if you want to understand commentary like "components from GC" and "DPY's PIXMAP".

Similarly for nearly every library function Emacs calls. GMP should be no different from other libraries in this respect.

But I really meant that stuff like this lacks a comment:

      hz = make_integer_mpz ();
      mpz_swap (mpz[0], *iticks);
      ticks = make_integer_mpz ();

And also functions like timespec_ticks, lisp_time_hz_ticks, and
lisp_time_seconds, which don't have a single comment describing how
they do their thing.

I added a few comments here and there. But I didn't go down to the level of commenting every call.

But it might be better in master to remove the "Invalid time format"
check entirely.

I'm fine with removing that test, if we are sure that invoking
run-at-time with something utterly un-timely, like a symbol or a a
string that cannot be a valid time description, will trigger an error
(presumably from timer-set-time).

Yes, that's what happens. I removed the test in master.





reply via email to

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