[Top][All Lists]

[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 19:55:46 -0700

Thank you, Alex ... I like the idea of not using a Lisp_Object to store the 
various window caches of fake cursors, as this would entirely eliminate the 
garbage collection issues.  Inasmuch as this would be my first usage of an 
array in the world of programming, some guidance regarding the best way to 
initialize the array (window cache) would be greatly appreciated.

The foreground and background colors of each fake cursor are sets of three 
doubles (red/green/blue).  They do not necessarily need to be stored as a set 
of three, and could be broken up into separate columns within the array if that 
is more prudent.  active_p is a boolean type, but could be expressed as an int 

I saw a few online examples that initialize an array as int _or_ double, but 
not both simultaneously.  So, I thought to myself that they could all be 
doubles if need be ....

I saw three types of arrays:  an array matching an exact size known in advance; 
an array that is defined with a specified MAX_ROW / MAX_COL (some rows/columns 
may never be used); and, an array using dynamic allocation with malloc, realloc 
and free.

Each window cache should be able to handle up to 250 fake cursors.  The present 
design uses up to four (4) different window caches for each window where fake 
cursors are active.  Each fake cursor would need entries in the cache of either 
14 elements or 18 elements, depending upon whether the foreground/background 
colors are grouped or broken up.

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


> Date: [04-14-2019 16:31:16] <14 Apr 2019 17:31:16 -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?
> * * *
> Looking at your actual implementation though, I don't see a reason for your 
> cache to be a Lisp_Object at all; am I missing something?  It seems that you 
> could just use a C array of length 14.  Not making any cons cells at all is 
> the best approach if you can do so.
> * * *

reply via email to

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