Re: [PATCH] binary heap implementation

Abhijit Menon-Sen <ams@2ndquadrant.com>

From: Abhijit Menon-Sen <ams@2ndQuadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Andres Freund <andres@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2012-11-22T02:39:51Z
Lists: pgsql-hackers
At 2012-11-21 15:09:12 -0500, robertmhaas@gmail.com wrote:
>
> > The following comments still talk about "key and value", thus need
> > an update:
> 
> Oops.

In the same vein, "Returns NULL if the heap is empty" no longer applies
to binaryheap_first and binaryheap_remove_first. Plus there is an extra
asterisk in the middle of the comment about binaryheap_replace_first.

But it looks good otherwise.

I agree with Tom that we should support resizing the heap, but let's not
bother with that now. I'll write the few extra lines of code the first
time something actually needs to add more elements to a heap.

-- Abhijit


Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix memory leaks in record_out() and record_send().