On Thu, May 03, 2018 at 03:21:13PM +0800, Jason Wang wrote:
>
>
> On 2018年05月03日 15:10, Peter Xu wrote:
> > On Fri, Apr 27, 2018 at 01:53:35PM +0800, Jason Wang wrote:
> >
> > [...]
> >
> > > > +int it_tree_remove(ITTree *tree, ITValue start, ITValue end)
> > > > +{
> > > > +ITRange range =
On 2018年05月03日 15:10, Peter Xu wrote:
On Fri, Apr 27, 2018 at 01:53:35PM +0800, Jason Wang wrote:
[...]
+int it_tree_remove(ITTree *tree, ITValue start, ITValue end)
+{
+ITRange range = { .start = start, .end = end }, *overlap, and;
+GTree *gtree;
+
+g_assert(tree);
+
+gtree
On Fri, Apr 27, 2018 at 01:53:35PM +0800, Jason Wang wrote:
[...]
> > +int it_tree_remove(ITTree *tree, ITValue start, ITValue end)
> > +{
> > +ITRange range = { .start = start, .end = end }, *overlap, and;
> > +GTree *gtree;
> > +
> > +g_assert(tree);
> > +
> > +gtree = tree->tre
On Fri, Apr 27, 2018 at 01:53:35PM +0800, Jason Wang wrote:
[...]
> > +/* Merge right adjacent range */
> > +overlap = it_tree_find_value(tree, end + 1);
> > +if (overlap) {
> > +range->end = overlap->end;
> > +g_tree_remove(gtree, overlap);
> > +}
> > +
> > +/
On 2018年04月25日 12:51, Peter Xu wrote:
Introduce a simplest interval tree implementation based on GTree.
Current implementation is mostly tailored to maintain and trace device
mapped IOVA ranges, but still it might be useful to other modules in the
future.
It is naive in that it even does not a
Introduce a simplest interval tree implementation based on GTree.
Current implementation is mostly tailored to maintain and trace device
mapped IOVA ranges, but still it might be useful to other modules in the
future.
It is naive in that it even does not allow user to pass in private
structs along