On Fri, Jul 27, 2012 at 8:57 PM, John Stultz <john.stultz@xxxxxxxxxx> wrote:Correct. Any overlapping range is coalesced.v5:Actually, I believe the ranges you need to track are non-overlapping, correct ?
* Drop intervaltree for prio_tree usage per Michel &
Dmitry's suggestions.
If that is the case, a simple rbtree, sorted by start-of-range
address, would work best.
(I am trying to remove prio_tree users... :)
Thanks! I think I hit this off-by-one issue in my testing, but fixed it on the backend w/ :+ /* First, find any existing intervals that overlap */Note that prio tree iterations take intervals as [start; last] not [start; end[
+ prio_tree_iter_init(&iter, root, start, end);
So if you want to stick with prio trees, you would have to use end-1 here.
+ node = prio_tree_next(&iter);I'm confused, I don't think you ever expect more than one range to
+ while (node) {
match, do you ???
This is far from a complete code review, but I just wanted to point
out a couple details that jumped to me first. I am afraid I am missing
some of the background about how the feature is to be used to really
dig into the rest of the changes at this point :/