Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
0b885e23
Commit
0b885e23
authored
May 13, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Release allocated memory during AtAbort_Memory.
parent
eb4d9f45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
6 deletions
+35
-6
src/backend/access/transam/xact.c
src/backend/access/transam/xact.c
+35
-6
No files found.
src/backend/access/transam/xact.c
View file @
0b885e23
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.3
4 1999/05/09 00:52:08
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.3
5 1999/05/13 00:34:57
tgl Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
...
...
@@ -690,13 +690,27 @@ AtCommit_Locks()
static
void
AtCommit_Memory
()
{
Portal
portal
;
MemoryContext
portalContext
;
/* ----------------
* now that we're "out" of a transaction, have the
* Release memory in the blank portal.
* Since EndPortalAllocMode implicitly works on the current context,
* first make real sure that the blank portal is the selected context.
* (This is probably not necessary, but seems like a good idea...)
* ----------------
*/
portal
=
GetPortalByName
(
NULL
);
portalContext
=
(
MemoryContext
)
PortalGetHeapMemory
(
portal
);
MemoryContextSwitchTo
(
portalContext
);
EndPortalAllocMode
();
/* ----------------
* Now that we're "out" of a transaction, have the
* system allocate things in the top memory context instead
* of the blank portal memory context.
* ----------------
*/
EndPortalAllocMode
();
MemoryContextSwitchTo
(
TopMemoryContext
);
}
...
...
@@ -770,10 +784,25 @@ AtAbort_Locks()
static
void
AtAbort_Memory
()
{
Portal
portal
;
MemoryContext
portalContext
;
/* ----------------
* Release memory in the blank portal.
* Since EndPortalAllocMode implicitly works on the current context,
* first make real sure that the blank portal is the selected context.
* (This is ESSENTIAL in case we aborted from someplace where it wasn't.)
* ----------------
*/
portal
=
GetPortalByName
(
NULL
);
portalContext
=
(
MemoryContext
)
PortalGetHeapMemory
(
portal
);
MemoryContextSwitchTo
(
portalContext
);
EndPortalAllocMode
();
/* ----------------
*
after doing an abort transaction, make certain
the
* system
uses the top memory context rather then the
*
portal memory context (until the next transaction)
.
*
Now that we're "out" of a transaction, have
the
* system
allocate things in the top memory context instead
*
of the blank portal memory context
.
* ----------------
*/
MemoryContextSwitchTo
(
TopMemoryContext
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment