Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac12412

Browse files
committed
Revise memory management for libxml calls. Instead of keeping libxml's data
in whichever context happens to be current during a call of an xml.c function,use a dedicated context that will not go away until we explicitly delete it(which we do at transaction end or subtransaction abort). This makes recoveryafter an error much simpler --- we don't have to individually delete the datastructures created by libxml. Also, we need to initialize and cleanup libxmlonly once per transaction (if there's no error) instead of once per functioncall, so it should be a bit faster. We'll need to keep an eye out forintra-transaction memory leaks, though. Alvaro and Tom.
1 parentdeb7ded commitac12412

File tree

3 files changed

+252
-255
lines changed

3 files changed

+252
-255
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.256 2008/01/03 21:23:15 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.257 2008/01/15 18:56:59 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -45,6 +45,7 @@
4545
#include"utils/inval.h"
4646
#include"utils/memutils.h"
4747
#include"utils/relcache.h"
48+
#include"utils/xml.h"
4849

4950

5051
/*
@@ -1671,6 +1672,7 @@ CommitTransaction(void)
16711672

16721673
AtEOXact_GUC(true,1);
16731674
AtEOXact_SPI(true);
1675+
AtEOXact_xml();
16741676
AtEOXact_on_commit_actions(true);
16751677
AtEOXact_Namespace(true);
16761678
/* smgrcommit already done */
@@ -1880,6 +1882,7 @@ PrepareTransaction(void)
18801882
/* PREPARE acts the same as COMMIT as far as GUC is concerned */
18811883
AtEOXact_GUC(true,1);
18821884
AtEOXact_SPI(true);
1885+
AtEOXact_xml();
18831886
AtEOXact_on_commit_actions(true);
18841887
AtEOXact_Namespace(true);
18851888
/* smgrcommit already done */
@@ -2021,6 +2024,7 @@ AbortTransaction(void)
20212024

20222025
AtEOXact_GUC(false,1);
20232026
AtEOXact_SPI(false);
2027+
AtEOXact_xml();
20242028
AtEOXact_on_commit_actions(false);
20252029
AtEOXact_Namespace(false);
20262030
smgrabort();
@@ -3851,6 +3855,7 @@ AbortSubTransaction(void)
38513855

38523856
AtEOXact_GUC(false,s->gucNestLevel);
38533857
AtEOSubXact_SPI(false,s->subTransactionId);
3858+
AtEOXact_xml();
38543859
AtEOSubXact_on_commit_actions(false,s->subTransactionId,
38553860
s->parent->subTransactionId);
38563861
AtEOSubXact_Namespace(false,s->subTransactionId,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp