From dd43eeb04a594b058d9e89b24f645bbc9f8e58da Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 16 Jan 2014 10:30:52 -0500 Subject: [PATCH] Note problems. --- src/backend/utils/mmgr/mspan.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/utils/mmgr/mspan.c b/src/backend/utils/mmgr/mspan.c index 4463910ea7..3f289cd0c3 100644 --- a/src/backend/utils/mmgr/mspan.c +++ b/src/backend/utils/mmgr/mspan.c @@ -683,6 +683,11 @@ mspan_release_span(char *base, mspan_manager *mgr, mspan *span) span->first_page = preceding_span->first_page; span->npages += preceding_span->npages; mspan_destroy_span(base, preceding_span); + /* + * XXX. This is a problem. Suppose we destroy the preceding span + * and it releases a superblock just preceding the current span. + * Now that span can't consolidate with this one nor visca versa. + */ } } if (mgr->npages == 0 || span->first_page + span->npages < mgr->boundary) @@ -698,6 +703,10 @@ mspan_release_span(char *base, mspan_manager *mgr, mspan *span) mspan_unlink_span(base, following_span); span->npages += following_span->npages; mspan_destroy_span(base, following_span); + /* + * XXX. Here again, destroying the following span could create + * another free chunk that needs to be consolidated with this span. + */ } } -- 2.39.5