Update comment, generation mem contexts have a "keeper" block
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 25 Jan 2024 23:04:58 +0000 (01:04 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 25 Jan 2024 23:04:58 +0000 (01:04 +0200)
The keeper block was introduced in commit 1b0d9aa4f7, but it forgot
to update this comment.

src/backend/utils/mmgr/generation.c

index 65fd00d0137b2c68bf7368e0aa5edd97ef08b5b2..f9016a7ed72743b065f6514486ee4003ca128c8f 100644 (file)
@@ -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)