Thank you, Alex, for helping to diagnose the issue of excessive garbage
collection. I observe the issue when building Emacs on an OSX machine using
the --with-ns flag. The issue may also occur on the w32 and X11 builds of
Emacs, but it is not noticeable to my naked eye. The NS build, on the other
hand, permits me to see an appreciable pause for garbage collection every few
keystrokes. The garbage collection tests with *_consed that I performed today
were on the NS port of Emacs.
The usage of Ftruncate in the 04/08/2019 proof concept patch of fake cursors
occurs only in w32term.c and xterm.c.
My general understanding is as follows:
1. Emacs uses nsterm.m/h when building on an OSX machine and the --with-ns
flag.
2. Emacs uses xterm.c when building on an OSX machine that has X11 installed
and the following flags are used: --with-x (yes) and --with-ns (no).
3. Emacs uses w32term.c when building on a Windows machine.
I would be pleased to remove Ftruncate and replace it with roundf. Thank you
for the suggestion. The development of the fake cursors feature has been a
work in progress for a little over 3 years now ... learning some C coding along
the way. I have seen roundf in a few internet examples over the years, and
have a vague recollection of trying to use it somewhere -- however, I cannot
remember in what context.
Perhaps there is a similar mistake I have made that would affect the NS build
of Emacs, or perhaps would affect all of the builds (NS/w32/X11). It is
interesting that excessive garbage collection occurs even with the fake cursors
feature turned _off_, and it gets much worse when that feature is turned _on_.
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;