emacs-devel
[Top][All Lists]
Advanced

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

Re: NS port: How to debug excessive garbage collection?


From: Keith David Bershatsky
Subject: Re: NS port: How to debug excessive garbage collection?
Date: Sun, 14 Apr 2019 22:19:47 -0700

Thank you, Alex, for the example structs and also for the zeroing out example 
-- greatly appreciated!

Yes, 250 fake cursors is an arbitrary upper limit based upon my own imagination 
of how many a user might reasonably use in any given window.  The crosshairs 
feature uses approximately that amount per window.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> Date: [04-14-2019 20:44:41] <14 Apr 2019 21:44:41 -0600>
> From: Alex Gramiak <address@hidden>
> To: Keith David Bershatsky <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden
> Subject: Re: NS port: How to debug excessive garbage collection?
> 
> * * *
> 
> > Each window cache should be able to handle up to 250 fake cursors.
> 
> Is 250 an arbitrary limit?
> 
> > How do you recommend that the array for each window cache be initialized?
> >
> > 1.  int x
> > 2.  int fx
> > 3.  int y
> > 4.  int fy
> > 5.  int hpos
> > 6.  int vpos
> > 7.  int wd
> > 8.  int h
> > 9.  int cursor_type
> > 10. int cursor_width
> > 11. double foreground_red
> > 12. double foreground_green
> > 13. double foreground_blue
> > 14. double background_red
> > 15. double background_green
> > 16. double background_blue
> > 17. bool active_p
> > 18. int glyph_flavor
> 
> To change it to a struct (with a helper struct):
> 
>   struct RGB
>   {
>     double red;
>     double green;
>     double blue;
>   };
> 
>   struct multiple_cursor_cache
>   {
>     int x;
>     int fx;
>     int y;
>     int fy;
>     int hpos;
>     int vpos;
>     int wd;
>     int h;
>     int cursor_type;
>     int cursor_width;
>     struct RGB foreground;
>     struct RGB background;
>     bool active_p;
>     int glyph_flavor;
>   };
> 
> Then you have:
> 
>   struct multiple_cursor_cache mc_cache;
> 
> and to set elements:
> 
>   w->mc_cache.x = x;
>   w->mc_cache.foreground.red = red;
> 
> To set all elements to zero, one does:
> 
>   memset (&variable, 0, sizeof (variable));



reply via email to

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