Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: segfault via completion menu

On Tue, May 21, 2019 at 2:59 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Oliver Kiddle wrote on Mon, 20 May 2019 20:57 +00:00:
> > Backing that out on top of master appears to fix the issue. As it was an
> > optimisation, that might be an option. From reading comments in mem.c,
> > it's not especially clear to me what newheaps/oldheaps do. There's only
> > the one other use.
> It's not too clear to me either.

Operationally, the difference between pushheap() and NEWHEAPS() is
that pushing scans the entire list of existing heap blocks and moves
them out of the way in favor of new empty blocks.  This is
time-consuming and eats a lot of memory if you're in a tightly
recursive function (read back through the articles leading up to the
change).  In contrast, NEWHEAPS() just starts an entirely new chain of
heap blocks without reference to the existing chain.

If an error occurs as a result of NEWHEAPS()/OLDHEAPS() in the context
of workers/36853, it ought to be traceable to something leaking
heap-allocated storage across boundaries, and probably means there was
a memory leak when interrupting a pattern match before, which this has
turned into an error by freeing the previously leaked space.

Messages sorted by: Reverse Date, Date, Thread, Author