mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
Compare commits
3 commits
7a84008270
...
e0517ecbe6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0517ecbe6 | ||
|
|
6b6efe2128 | ||
|
|
c5be680ec3 |
3 changed files with 10 additions and 9 deletions
|
|
@ -468,7 +468,7 @@ This function is called from a timer; see `igc-start-collecting-stats'."
|
|||
;;; Opportunistic GC
|
||||
|
||||
(defvar igc--idle-timer nil
|
||||
"Idle timer to trigger oppurtunistic GC.")
|
||||
"Idle timer to trigger opportunistic GC.")
|
||||
|
||||
(defvar igc--idle-delay 1.0
|
||||
"Time, in seconds, to wait for `igc--idle-timer'.")
|
||||
|
|
@ -490,14 +490,18 @@ This function is called from a timer; see `igc-start-collecting-stats'."
|
|||
#'igc--on-idle (vector nil) 0)))
|
||||
|
||||
(defun igc--current-idle-time ()
|
||||
"Time since the last command finished, in seconds as a float.
|
||||
See `igc--on-idle'."
|
||||
(let ((idle-time (current-idle-time)))
|
||||
(if idle-time (float-time idle-time) 0)))
|
||||
|
||||
(defun igc--predict-idle-time ()
|
||||
"Predict available time until the next command starts.
|
||||
See `igc--on-idle'."
|
||||
(* (igc--current-idle-time) 0.80))
|
||||
|
||||
;; The igc-idle-timer works a bit like the blink-cursor-timer. It can
|
||||
;; call 'gc--on-idle' multiple times per idle cycle either until some GC
|
||||
;; call 'igc--on-idle' multiple times per idle cycle either until some GC
|
||||
;; work is done or until `igc--idle-repetitions' is reached. We do this
|
||||
;; because our idle time prediction primarily depends on the
|
||||
;; `current-idle-time', i.e. our predicted idle time gets larger the
|
||||
|
|
@ -509,6 +513,9 @@ This function is called from a timer; see `igc-start-collecting-stats'."
|
|||
;; calling 'igc--arena-step' again.
|
||||
|
||||
(defun igc--on-idle (state repetition)
|
||||
"Timer function to do GC in idle Emacs state.
|
||||
Calls igc--arena-step, wrapper for mps_arena_step for this very purpose.
|
||||
See `igc-start-idle-timer."
|
||||
(let ((timer2 (aref state 0)))
|
||||
(when timer2
|
||||
(cancel-timer timer2)))
|
||||
|
|
|
|||
|
|
@ -4137,7 +4137,7 @@ process_one_message (struct igc *gc)
|
|||
= mps_message_gc_not_condemned_size (gc->arena, msg);
|
||||
mps_clock_t clock = mps_message_clock (gc->arena, msg);
|
||||
double secs = (double) clock / mps_clocks_per_sec ();
|
||||
message ("[%f] GC: condemned: %" pD "u live: %" pD "u "
|
||||
message ("[%f] GC end: condemned: %" pD "u live: %" pD "u "
|
||||
"not_condemned: %" pD "u",
|
||||
secs, condemned, live, not_condemned);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,9 +182,6 @@ void *igc_alloc_dump (size_t nbytes);
|
|||
bool igc_busy_p (void);
|
||||
Lisp_Object igc_discard_killed_buffers (Lisp_Object list);
|
||||
|
||||
ptrdiff_t igc_pin (void *obj);
|
||||
void igc_unpin (void *obj, ptrdiff_t idx);
|
||||
|
||||
# define eassert_not_mps() eassert (false)
|
||||
|
||||
# define eassert_not_mps() eassert (false)
|
||||
|
|
@ -204,9 +201,6 @@ void w32_remove_non_lisp_thread (void *);
|
|||
extern void igc_assert_not_an_mps_object (void *ptr);
|
||||
# define eassert_not_mps() eassert (false)
|
||||
|
||||
ptrdiff_t igc_pin (void *obj);
|
||||
void igc_unpin (void *obj, ptrdiff_t idx);
|
||||
|
||||
#else
|
||||
# define igc_break() (void) 0
|
||||
# define eassert_not_mps() (void) 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue