From d0b4399d81f39decccb23fa38f772b71b51bf96a Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Wed, 26 May 2004 04:41:50 +0000 Subject: Reimplement the linked list data structure used throughout the backend. In the past, we used a 'Lispy' linked list implementation: a "list" was merely a pointer to the head node of the list. The problem with that design is that it makes lappend() and length() linear time. This patch fixes that problem (and others) by maintaining a count of the list length and a pointer to the tail node along with each head node pointer. A "list" is now a pointer to a structure containing some meta-data about the list; the head and tail pointers in that structure refer to ListCell structures that maintain the actual linked list of nodes. The function names of the list API have also been changed to, I hope, be more logically consistent. By default, the old function names are still available; they will be disabled-by-default once the rest of the tree has been updated to use the new API names. --- src/backend/commands/async.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/async.c') diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 15d7c0aae5c..847f73ff06a 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.111 2004/05/23 03:50:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.112 2004/05/26 04:41:10 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -932,7 +932,7 @@ NotifyMyFrontEnd(char *relname, int32 listenerPID) static bool AsyncExistsPendingNotify(const char *relname) { - List *p; + ListCell *p; foreach(p, pendingNotifies) { -- cgit v1.2.3