From ca1fd0ea5b10e133a3ed00594fa908d5b647fa3d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 27 Aug 2006 19:11:46 +0000 Subject: [PATCH] Move xact.c's partial support for Lists of TransactionIds into pg_list.h. Needed because lock.c is now going to use the same type of list. --- src/backend/access/transam/xact.c | 10 +--------- src/include/nodes/pg_list.h | 13 ++++++++++++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 81c2583571..6fda0ce1f9 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.225 2006/07/30 02:07:18 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.226 2006/08/27 19:11:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -125,14 +125,6 @@ typedef struct TransactionStateData typedef TransactionStateData *TransactionState; -/* - * childXids is currently implemented as an Oid List, relying on the - * assumption that TransactionIds are no wider than Oid. We use these - * macros to provide some isolation in case that changes in the future. - */ -#define lfirst_xid(lc) ((TransactionId) lfirst_oid(lc)) -#define lappend_xid(list, datum) lappend_oid(list, (Oid) (datum)) - /* * CurrentTransactionState always points to the current transaction state * block. It will point to TopTransactionStateData when not in a diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index 945fdf9634..6175bc1e2e 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -26,11 +26,16 @@ * (At the moment, ints and Oids are the same size, but they may not * always be so; try to be careful to maintain the distinction.) * + * There is also limited support for lists of TransactionIds; since these + * are used in only one or two places, we don't provide a full implementation, + * but map them onto Oid lists. This effectively assumes that TransactionId + * is no wider than Oid and both are unsigned types. + * * * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.54 2006/03/05 15:58:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.55 2006/08/27 19:11:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -154,6 +159,12 @@ extern int list_length(List *l); #define list_make3_oid(x1,x2,x3) lcons_oid(x1, list_make2_oid(x2, x3)) #define list_make4_oid(x1,x2,x3,x4) lcons_oid(x1, list_make3_oid(x2, x3, x4)) +/* + * Limited support for lists of TransactionIds, mapped onto lists of Oids + */ +#define lfirst_xid(lc) ((TransactionId) lfirst_oid(lc)) +#define lappend_xid(list, datum) lappend_oid(list, (Oid) (datum)) + /* * foreach - * a convenience macro which loops through the list