updated list rewrite

Lists: pgsql-patches
From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: updated list rewrite
Date: 2004-05-24 10:56:34
Message-ID: 40B1D4E2.7030603@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

I've attached a new version of the list rewrite patch (gzip'ed). Changes
since the last patch:

- incorporate two bugfixes from Tom: off-by-one in list_nth() and
replace another lfirst() in optimizer/plan/createplan.c with
lfirst(list_head())

- reimplement list_difference() and list_union(); rather than trying to
provide one function that works for all kinds of lists, give up on
trying to reuse code and provide datatype specific functions. This means
we don't need list_append_auto() and list_member_auto(). Along the way,
fix a bug in list_difference() pointed out by Tom.

- replace list_head(), list_tail() and list_length() macros with GCC
inline functions, when possible (otherwise, we fall back to out-of-line
functions). This avoids doubly-evaluating the macro arguments, but it
will likely result in a performance hit for non-GCC compilers. Since
inline functions are specified by C99, we shouldn't assume that CC !=
gcc implies inline functions aren't available, but I'll revisit this later.

- add linitial(), linitial_int(), and linitial_oid(). I haven't actually
changed the tree to use these macros yet, though.

- add a new #define LIST_CELL_TYPE in pg_list.h to reduce the number of
list compatibility #ifdefs

-Neil

Attachment Content-Type Size
partial-list-rewrite-75.patch.gz application/x-gzip 62.4 KB

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: updated list rewrite
Date: 2004-05-24 14:46:10
Message-ID: c8t1rm$38a$1@floppy.pyrenet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Neil Conway wrote:

> I've attached a new version of the list rewrite patch (gzip'ed). Changes
> since the last patch:

I never dig on postgresql code in order to see how and where lists are used,
I'm wondering if also a "rope" could be usefull somewhere.

Regards
Gaetano Mendola