[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: Alex Gramiak
Subject: Re: NS port: How to debug excessive garbage collection?
Date: Mon, 15 Apr 2019 23:26:05 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Keith David Bershatsky <address@hidden> writes:

> I am working on implementing the suggestion of Alex to use structures to store
> the data for each fake cursor on a per window basis, instead of the prior 
> method
> that created a Lisp_Object of cons cells (causing the excessive garbage
> collection issue).
> It seemed to me that the implementation of creating the vector to store glyph
> rows looked somewhat similar to what we want to do here. I attempted to 
> borrow a
> portion of that vector glyph row implementation in the attached working 
> example
> that applies to the master branch as of 04/08/2019
> (a038df77de7b1aa2d73a6478493b8838b59e4982).
> I had hoped to keep the cache (w->mc_elts) alive for the duration that the 
> fake
> cursors feature is active in a visible window. However, the cache (w->mc_elts)
> disappears and becomes NULL. In the attached example, whenever it is time to
> increase the size of the dynamic vector, I set the value of w->mc_elts[99].x 
> to
> 99. The value of -1 is used in the stderr printout whenever w->mc_elts is 

The problem here is that since you changed the single struct cache to an
array of caches, you need to also change the memset call to match it.
Right now you are setting the pointer variable to 0/NULL. It should now

  memset (w->mc_elts, 0, w->mc_nelts * (sizeof *w->mc_elts));

Which sets the memory block of mc_nelts cache structs pointed to
by mc_elts to 0.

reply via email to

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