GNU bug report logs -
#58158
29.0.50; [overlay] Interval tree iteration considered harmful
Previous Next
Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Date: Thu, 29 Sep 2022 05:30:02 UTC
Severity: normal
Found in version 29.0.50
Fixed in version 30.1
Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #65 received at 58158 <at> debbugs.gnu.org (full text, mbox):
Gerd Möllmann [2022-09-30 07:28:26] wrote:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> I changed the code to store the `visited` bit in the work stack, but if
>> you could rewrite the `interval_generator_next` along the lines of the
>> code above that would be great.
> Ok, I'll rewrite that :-). When I understand what that "narrowing" is
> and how and for what it is used.
The traversals are always bound by begin..end boundaries. Usually we
know those bounds upfront (e.g. for `overlays-in` or `overlay-at`), but
when doing things like `next/previous-overlay-change` one of the bounds
is not know at first, so in order to try and avoid the O(N) complexity
the code refines that other bound on the fly (e.g. when searching
forward, after seeing an overlay that ends at POS we know that there's no
point looking further than POS so we can move the end boundary to POS).
> BTW, what do you think of changing function names to something a bit
> shorter? I find myself constantly getting confused when reading the
> code. I think an "itree_" prefix would suffice for non-static
> functions, and static ones without prefix.
Fine by me, yes.
Stefan
This bug report was last modified 1 year and 311 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.