diff options
| author | Paul Eggert | 2019-09-14 10:55:53 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-09-14 10:56:12 -0700 |
| commit | 52172d234015776bcc595c731477b98fa2949e50 (patch) | |
| tree | 0c05e7a146f66f07095efbe9d64a7beccb0ca524 /src/alloc.c | |
| parent | 1acc0cc9aaf25c808a60cf09cf8a4d1c653c3aa9 (diff) | |
| download | emacs-52172d234015776bcc595c731477b98fa2949e50.tar.gz emacs-52172d234015776bcc595c731477b98fa2949e50.zip | |
Fix gc-elapsed rounding bug
* src/alloc.c (garbage_collect): Don’t accumulate rounding
errors when computing gc-elapsed.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c index 497f600551e..9fbd0d05739 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6021,9 +6021,10 @@ garbage_collect (void) | |||
| 6021 | /* Accumulate statistics. */ | 6021 | /* Accumulate statistics. */ |
| 6022 | if (FLOATP (Vgc_elapsed)) | 6022 | if (FLOATP (Vgc_elapsed)) |
| 6023 | { | 6023 | { |
| 6024 | struct timespec since_start = timespec_sub (current_timespec (), start); | 6024 | static struct timespec gc_elapsed; |
| 6025 | Vgc_elapsed = make_float (XFLOAT_DATA (Vgc_elapsed) | 6025 | gc_elapsed = timespec_add (gc_elapsed, |
| 6026 | + timespectod (since_start)); | 6026 | timespec_sub (current_timespec (), start)); |
| 6027 | Vgc_elapsed = make_float (timespectod (gc_elapsed)); | ||
| 6027 | } | 6028 | } |
| 6028 | 6029 | ||
| 6029 | gcs_done++; | 6030 | gcs_done++; |