summaryrefslogtreecommitdiff
path: root/src/backend/postmaster/autovacuum.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/postmaster/autovacuum.c
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/postmaster/autovacuum.c')
-rw-r--r--src/backend/postmaster/autovacuum.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3a6f24a0237..86a3b3d8be2 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -555,7 +555,7 @@ AutoVacLauncherMain(int argc, char *argv[])
FlushErrorState();
/* Flush any leaked data in the top-level context */
- MemoryContextResetAndDeleteChildren(AutovacMemCxt);
+ MemoryContextReset(AutovacMemCxt);
/* don't leave dangling pointers to freed memory */
DatabaseListCxt = NULL;
@@ -2521,7 +2521,7 @@ do_autovacuum(void)
/* clean up memory before each iteration */
- MemoryContextResetAndDeleteChildren(PortalContext);
+ MemoryContextReset(PortalContext);
/*
* Save the relation name for a possible error message, to avoid a
@@ -2576,7 +2576,7 @@ do_autovacuum(void)
/* this resets ProcGlobal->statusFlags[i] too */
AbortOutOfAnyTransaction();
FlushErrorState();
- MemoryContextResetAndDeleteChildren(PortalContext);
+ MemoryContextReset(PortalContext);
/* restart our transaction for the following operations */
StartTransactionCommand();
@@ -2718,7 +2718,7 @@ perform_work_item(AutoVacuumWorkItem *workitem)
autovac_report_workitem(workitem, cur_nspname, cur_relname);
/* clean up memory before each work item */
- MemoryContextResetAndDeleteChildren(PortalContext);
+ MemoryContextReset(PortalContext);
/*
* We will abort the current work item if something errors out, and
@@ -2770,7 +2770,7 @@ perform_work_item(AutoVacuumWorkItem *workitem)
/* this resets ProcGlobal->statusFlags[i] too */
AbortOutOfAnyTransaction();
FlushErrorState();
- MemoryContextResetAndDeleteChildren(PortalContext);
+ MemoryContextReset(PortalContext);
/* restart our transaction for the following operations */
StartTransactionCommand();