Messages in this thread | | | Date | Fri, 21 Apr 2006 12:25:56 -0700 | From | Zach Brown <> | Subject | Re: [PATCH] Shrink rbtree |
| |
> Maybe. I thought I'd actually done it once before, but I couldn't > actually find it when I went looking.
Yeah, that's what I remember too.
> Plenty more words in the git commit.
Ah! of course, thanks.
> They don't make much sense without > the patch right below them, and you can see them in juxtaposition at > http://git.infradead.org/?p=users/dwmw2/rbtree-2.6.git;a=commitdiff;h=1975e59375756da4ff4e6e7d12f67485e813ace0
Indeed, that reasoning looks sound. First the if (parent) .. else {} falls away, then the parent left/right relationship is folded into the test with old. Looks good.
> I think it's be better just to drop the RB_RED and RB_BLACK definitions.
I'd agree, I figured you'd left them for a reason.
>>> +static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p) >>> +{ >> BUG_ON((unsigned long)p & 3); > > Yeah, I suppose we could.
>>> + node->rb_parent_colour = (unsigned long )parent; >> use rb_set_parent(node, parent) and get the assertion. > > Que?
I meant that if we add the BUG_ON() to rb_set_parent() then we might as well reuse it here..
- z - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |