Re: [CFReview] Red-Black Tree - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [CFReview] Red-Black Tree
Date
Msg-id 603c8f071002081935m490bc392g9eefff50054d8015@mail.gmail.com
Whole thread Raw
In response to Re: [CFReview] Red-Black Tree  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: [CFReview] Red-Black Tree
Re: [CFReview] Red-Black Tree
List pgsql-hackers
On Mon, Feb 8, 2010 at 3:05 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> It seems a bit strange to have all the rb_free_recursive support and not
> use it anywhere ... and a freefunc callback even, whose only caller
> seems to set as null currently.  Hmm, even in the knngist patch the
> rb_freefunc stuff is unused.

I don't think it's inappropriate;  it doesn't seem implausible that
someone might want to free an rbtree someday.  I suppose we could
comment it out but I guess I don't see the point.

> How do we now that it works?

Visual inspection?  It's not very complicated.

> (What, for example, if we were to allocate multiple nodes in a single
> palloc chunk?  I'm not familiar with this stuff but that seems
> plausible)

Well, then you could have the freefunc do something ((MyStruct *)
a)->is_allocated = false.

...Robert


pgsql-hackers by date:

Previous
From: M Z
Date:
Subject: CVS checkout source code for different branches
Next
From: Hitoshi Harada
Date:
Subject: Re: review: More frame options in window functions