summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorNathan Bossart2023-11-15 19:42:30 +0000
committerNathan Bossart2023-11-15 19:42:30 +0000
commit6a72c42fd5af7ada49584694f543eb06dddb4a87 (patch)
treec2f566a161756b8aca8a58d58d4b0a0b6ee08da7 /src/backend/access
parent83267b15bf0dffa6e1096608bda95b8488048bb9 (diff)
Retire MemoryContextResetAndDeleteChildren() macro.
As of commit eaa5808e8e, MemoryContextResetAndDeleteChildren() is just a backwards compatibility macro for MemoryContextReset(). Now that some time has passed, this macro seems more likely to create confusion. This commit removes the macro and replaces all remaining uses with calls to MemoryContextReset(). Any third-party code that use this macro will need to be adjusted to call MemoryContextReset() instead. Since the two have behaved the same way since v9.5, such adjustments won't produce any behavior changes for all currently-supported versions of PostgreSQL. Reviewed-by: Amul Sul, Tom Lane, Alvaro Herrera, Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/20231113185950.GA1668018%40nathanxps13
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/brin/brin.c4
-rw-r--r--src/backend/access/gin/ginscan.c2
-rw-r--r--src/backend/access/transam/xact.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index 25338a90e29..f0eac078e0b 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -297,7 +297,7 @@ brininsert(Relation idxRel, Datum *values, bool *nulls,
samepage))
{
/* no luck; start over */
- MemoryContextResetAndDeleteChildren(tupcxt);
+ MemoryContextReset(tupcxt);
continue;
}
}
@@ -533,7 +533,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
CHECK_FOR_INTERRUPTS();
- MemoryContextResetAndDeleteChildren(perRangeCxt);
+ MemoryContextReset(perRangeCxt);
tup = brinGetTupleForHeapBlock(opaque->bo_rmAccess, heapBlk, &buf,
&off, &size, BUFFER_LOCK_SHARE);
diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c
index ae7b0e9bb87..f719577695a 100644
--- a/src/backend/access/gin/ginscan.c
+++ b/src/backend/access/gin/ginscan.c
@@ -251,7 +251,7 @@ ginFreeScanKeys(GinScanOpaque so)
tbm_free(entry->matchBitmap);
}
- MemoryContextResetAndDeleteChildren(so->keyCtx);
+ MemoryContextReset(so->keyCtx);
so->keys = NULL;
so->nkeys = 0;
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 8fad8ffa1eb..536edb3792f 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -1933,7 +1933,7 @@ AtCleanup_Memory(void)
* Clear the special abort context for next time.
*/
if (TransactionAbortContext != NULL)
- MemoryContextResetAndDeleteChildren(TransactionAbortContext);
+ MemoryContextReset(TransactionAbortContext);
/*
* Release all transaction-local memory.
@@ -1969,7 +1969,7 @@ AtSubCleanup_Memory(void)
* Clear the special abort context for next time.
*/
if (TransactionAbortContext != NULL)
- MemoryContextResetAndDeleteChildren(TransactionAbortContext);
+ MemoryContextReset(TransactionAbortContext);
/*
* Delete the subxact local memory contexts. Its CurTransactionContext can