aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-01-26 01:04:58 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-01-26 01:04:58 +0200
commit376c216138c75e161d39767650ea30536f23b482 (patch)
tree8d4627867ffe51427a82d1188720eef2023acb4c
parent8ba6fdf905d0f5aef70ced4504c6ad297bfe08ea (diff)
downloadpostgresql-376c216138c75e161d39767650ea30536f23b482.tar.gz
postgresql-376c216138c75e161d39767650ea30536f23b482.zip
Update comment, generation mem contexts have a "keeper" block
The keeper block was introduced in commit 1b0d9aa4f7, but it forgot to update this comment.
-rw-r--r--src/backend/utils/mmgr/generation.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/utils/mmgr/generation.c b/src/backend/utils/mmgr/generation.c
index 65fd00d0137..f9016a7ed72 100644
--- a/src/backend/utils/mmgr/generation.c
+++ b/src/backend/utils/mmgr/generation.c
@@ -271,8 +271,10 @@ GenerationContextCreate(MemoryContext parent,
* GenerationReset
* Frees all memory which is allocated in the given set.
*
- * The code simply frees all the blocks in the context - we don't keep any
- * keeper blocks or anything like that.
+ * The initial "keeper" block (which shares a malloc chunk with the context
+ * header) is not given back to the operating system though. In this way, we
+ * don't thrash malloc() when a context is repeatedly reset after small
+ * allocations.
*/
void
GenerationReset(MemoryContext context)