|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.50 1999/09/05 17:12:34 tgl Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.51 1999/09/09 16:25:35 tgl Exp $ |
11 | 11 | *
|
12 | 12 | * NOTES
|
13 | 13 | * Transaction aborts can now occur two ways:
|
@@ -694,19 +694,13 @@ static void
|
694 | 694 | AtCommit_Memory()
|
695 | 695 | {
|
696 | 696 | Portal portal;
|
697 |
| - MemoryContext portalContext; |
698 | 697 |
|
699 | 698 | /* ----------------
|
700 |
| - * Release memory in the blank portal. |
701 |
| - * Since EndPortalAllocMode implicitly works on the current context, |
702 |
| - * first make real sure that the blank portal is the selected context. |
703 |
| - * (This is probably not necessary, but seems like a good idea...) |
| 699 | + * Release all heap memory in the blank portal. |
704 | 700 | * ----------------
|
705 | 701 | */
|
706 | 702 | portal = GetPortalByName(NULL);
|
707 |
| - portalContext = (MemoryContext) PortalGetHeapMemory(portal); |
708 |
| - MemoryContextSwitchTo(portalContext); |
709 |
| - EndPortalAllocMode(); |
| 703 | + PortalResetHeapMemory(portal); |
710 | 704 |
|
711 | 705 | /* ----------------
|
712 | 706 | * Now that we're "out" of a transaction, have the
|
@@ -784,19 +778,13 @@ static void
|
784 | 778 | AtAbort_Memory()
|
785 | 779 | {
|
786 | 780 | Portal portal;
|
787 |
| - MemoryContext portalContext; |
788 | 781 |
|
789 | 782 | /* ----------------
|
790 |
| - * Release memory in the blank portal. |
791 |
| - * Since EndPortalAllocMode implicitly works on the current context, |
792 |
| - * first make real sure that the blank portal is the selected context. |
793 |
| - * (This is ESSENTIAL in case we aborted from someplace where it wasn't.) |
| 783 | + * Release all heap memory in the blank portal. |
794 | 784 | * ----------------
|
795 | 785 | */
|
796 | 786 | portal = GetPortalByName(NULL);
|
797 |
| - portalContext = (MemoryContext) PortalGetHeapMemory(portal); |
798 |
| - MemoryContextSwitchTo(portalContext); |
799 |
| - EndPortalAllocMode(); |
| 787 | + PortalResetHeapMemory(portal); |
800 | 788 |
|
801 | 789 | /* ----------------
|
802 | 790 | * Now that we're "out" of a transaction, have the
|
|
0 commit comments