emacs-devel
[Top][All Lists]
Advanced

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

Re: Overlays as an AA-tree


From: Joakim Jalap
Subject: Re: Overlays as an AA-tree
Date: Thu, 09 Feb 2017 11:05:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (berkeley-unix)

Andreas Politz <address@hidden> writes:

> I think, I got mostly everything ready, from Fmake_overlay to
> Fbuffer_swap_text. It compiles just fine after which it immediately dumps
> core -- but that's another problem.
>
> I am currently uncertain about how to properly allocate the memory I
> need for
>
> 1. traversing the tree (log(n)) and
> 2. storing some nodes (n)
>
> Number 1. isn't really a problem, since it can be allocated
> when an overlay is created and kept for the life-time of the buffer,
> since its size is pretty small.
>
> The other storage I need due to the problem with front-advance overlays
> while adjusting the overlays for insert. The size of this thing makes it
> not so size to keep around.  So, is it save to call xmalloc at this
> point ?
>
I think it should be. I used xmalloc all the time in my branch :) Isn't
the idea to gather the interval_nodes which begin at the point of insertion,
adjust them outside the tree and then reinsert them? Then you can free
the memory right after, no?

Why do you need to allocate memory to traverse the tree? Isn't the tree,
already there?



reply via email to

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