aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeWindowAgg.c
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-11-15 13:42:30 -0600
committerNathan Bossart <nathan@postgresql.org>2023-11-15 13:42:30 -0600
commit6a72c42fd5af7ada49584694f543eb06dddb4a87 (patch)
treec2f566a161756b8aca8a58d58d4b0a0b6ee08da7 /src/backend/executor/nodeWindowAgg.c
parent83267b15bf0dffa6e1096608bda95b8488048bb9 (diff)
downloadpostgresql-6a72c42fd5af7ada49584694f543eb06dddb4a87.tar.gz
postgresql-6a72c42fd5af7ada49584694f543eb06dddb4a87.zip
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/executor/nodeWindowAgg.c')
-rw-r--r--src/backend/executor/nodeWindowAgg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 77724a6daaf..3258305f57f 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -216,7 +216,7 @@ initialize_windowaggregate(WindowAggState *winstate,
* it, so we must leave it to the caller to reset at an appropriate time.
*/
if (peraggstate->aggcontext != winstate->aggcontext)
- MemoryContextResetAndDeleteChildren(peraggstate->aggcontext);
+ MemoryContextReset(peraggstate->aggcontext);
if (peraggstate->initValueIsNull)
peraggstate->transValue = peraggstate->initValue;
@@ -875,7 +875,7 @@ eval_windowaggregates(WindowAggState *winstate)
* result for it, else we'll leak memory.
*/
if (numaggs_restart > 0)
- MemoryContextResetAndDeleteChildren(winstate->aggcontext);
+ MemoryContextReset(winstate->aggcontext);
for (i = 0; i < numaggs; i++)
{
peraggstate = &winstate->peragg[i];
@@ -1351,12 +1351,12 @@ release_partition(WindowAggState *winstate)
* any aggregate temp data). We don't rely on retail pfree because some
* aggregates might have allocated data we don't have direct pointers to.
*/
- MemoryContextResetAndDeleteChildren(winstate->partcontext);
- MemoryContextResetAndDeleteChildren(winstate->aggcontext);
+ MemoryContextReset(winstate->partcontext);
+ MemoryContextReset(winstate->aggcontext);
for (i = 0; i < winstate->numaggs; i++)
{
if (winstate->peragg[i].aggcontext != winstate->aggcontext)
- MemoryContextResetAndDeleteChildren(winstate->peragg[i].aggcontext);
+ MemoryContextReset(winstate->peragg[i].aggcontext);
}
if (winstate->buffer)