Re: embedded list v2

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@postgresql.org>, Peter Geoghegan <peter@2ndquadrant.com>
Date: 2012-09-06T16:09:35Z
Lists: pgsql-hackers

Attachments

Here's a prettified version of this stuff.  I found one bug in the macro
ilist_s_head: the test was reversed.  Also, curiously, the macro had the
same name as the struct, so I renamed the macro.  I take it you haven't
used this macro, so maybe it shouldn't be there at all?  Or maybe I
completely misread what the macro is supposed to do.

I also renamed all the structs and functions by changing ilist_s_foo to
Slist_foo.  Similarly for ilist_d_foo.  This is all mechanical so any
subsequent patch should be trivial to refresh for this change.

I think README.ilist (which is what you had in the comment at the top of
ilist.h) should be heavily expanded.  I don't find it at all clear.

There were other cosmetic changes, but the implementation is pretty much
the same you submitted.

I didn't look at the other patch you posted, replacing dllist.c usage;
will do that next to verify that the list implementation works.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Provide some static-assertion functionality on all compilers.

  2. Add infrastructure for compile-time assertions about variable types.

  3. Remove 576 references of include files that were not needed.

  4. More include file adjustments.

  5. Allow each C include file to compile on its own by including any needed