From: Heikki Linnakangas Date: Mon, 22 Dec 2014 15:52:08 +0000 (+0200) Subject: Move rbtree.c from src/backend/utils/misc to src/backend/lib. X-Git-Tag: REL9_5_ALPHA1~1015 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=955557ddccb4065831af80b0966cbd02937dfb72;p=postgresql Move rbtree.c from src/backend/utils/misc to src/backend/lib. We have other general-purpose data structures in src/backend/lib, so it seems like a better home for the red-black tree as well. --- diff --git a/src/backend/lib/Makefile b/src/backend/lib/Makefile index b24ece68ad..949ee5e41d 100644 --- a/src/backend/lib/Makefile +++ b/src/backend/lib/Makefile @@ -12,6 +12,6 @@ subdir = src/backend/lib top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -OBJS = ilist.o binaryheap.o pairingheap.o stringinfo.o +OBJS = ilist.o binaryheap.o pairingheap.o rbtree.o stringinfo.o include $(top_srcdir)/src/backend/common.mk diff --git a/src/backend/lib/README b/src/backend/lib/README index 5f4038f08c..2f16351849 100644 --- a/src/backend/lib/README +++ b/src/backend/lib/README @@ -5,6 +5,8 @@ binaryheap.c - a binary heap pairingheap.c - a pairing heap +rbtree.c - a red-black tree + ilist.c - single and double-linked lists. stringinfo.c - an extensible string type @@ -19,6 +21,3 @@ while the binary heap works with plain Datums or pointers. The linked-lists in ilist.c can be embedded directly into other structs, as opposed to the List interface in nodes/pg_list.h. - -In addition to these, there is an implementation of a Red-Black tree in -src/backend/utils/adt/rbtree.c. diff --git a/src/backend/utils/misc/rbtree.c b/src/backend/lib/rbtree.c similarity index 99% rename from src/backend/utils/misc/rbtree.c rename to src/backend/lib/rbtree.c index e3efd4c08b..a450aa959e 100644 --- a/src/backend/utils/misc/rbtree.c +++ b/src/backend/lib/rbtree.c @@ -20,13 +20,13 @@ * Copyright (c) 2009-2014, PostgreSQL Global Development Group * * IDENTIFICATION - * src/backend/utils/misc/rbtree.c + * src/backend/lib/rbtree.c * *------------------------------------------------------------------------- */ #include "postgres.h" -#include "utils/rbtree.h" +#include "lib/rbtree.h" /* diff --git a/src/backend/utils/misc/Makefile b/src/backend/utils/misc/Makefile index c7b745e513..449d5b47ea 100644 --- a/src/backend/utils/misc/Makefile +++ b/src/backend/utils/misc/Makefile @@ -14,7 +14,7 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -OBJS = guc.o help_config.o pg_rusage.o ps_status.o rbtree.o \ +OBJS = guc.o help_config.o pg_rusage.o ps_status.o \ superuser.o timeout.o tzparser.o # This location might depend on the installation directories. Therefore diff --git a/src/include/access/gin_private.h b/src/include/access/gin_private.h index 3d46f20bb8..77f5ffd4bf 100644 --- a/src/include/access/gin_private.h +++ b/src/include/access/gin_private.h @@ -15,7 +15,7 @@ #include "access/itup.h" #include "fmgr.h" #include "storage/bufmgr.h" -#include "utils/rbtree.h" +#include "lib/rbtree.h" /* diff --git a/src/include/utils/rbtree.h b/src/include/lib/rbtree.h similarity index 98% rename from src/include/utils/rbtree.h rename to src/include/lib/rbtree.h index 0c94151ce5..e4a0f63810 100644 --- a/src/include/utils/rbtree.h +++ b/src/include/lib/rbtree.h @@ -6,7 +6,7 @@ * Copyright (c) 2009-2014, PostgreSQL Global Development Group * * IDENTIFICATION - * src/include/utils/rbtree.h + * src/include/lib/rbtree.h * *------------------------------------------------------------------------- */