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

Commit23543c7

Browse files
committed
Rewrite xml.c's memory management (yet again). Give up on the idea of
redirecting libxml's allocations into a Postgres context. Instead, just letit use malloc directly, and add PG_TRY blocks as needed to be sure we releaselibxml data structures in error recovery code paths. This is ugly but seemsmuch more likely to play nicely with third-party uses of libxml, as seen inrecent trouble reports about using Perl XML facilities in pl/perl and bug#4774 about contrib/xml2.I left the code for allocation redirection in place, but it's onlybuilt/used if you #define USE_LIBXMLCONTEXT. This is because I found ituseful to corral libxml's allocations in a palloc context when huntingfor libxml memory leaks, and we're surely going to have more of thosein the future with this type of approach. But we don't want it turned onin a normal build because it breaks exactly what we need to fix.I have not re-indented most of the code sections that are now wrappedby PG_TRY(); that's for ease of review. pg_indent will fix it.This is a pre-existing bug in 8.3, but I don't dare back-patch this changeuntil it's gotten a reasonable amount of field testing.
1 parentdb6e0b2 commit23543c7

File tree

3 files changed

+179
-113
lines changed

3 files changed

+179
-113
lines changed

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

Lines changed: 1 addition & 6 deletions
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.272 2009/01/20 18:59:37 heikki Exp $
13+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.273 2009/05/13 20:27:17 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -49,7 +49,6 @@
4949
#include"utils/memutils.h"
5050
#include"utils/relcache.h"
5151
#include"utils/snapmgr.h"
52-
#include"utils/xml.h"
5352
#include"pg_trace.h"
5453

5554

@@ -1701,7 +1700,6 @@ CommitTransaction(void)
17011700

17021701
AtEOXact_GUC(true,1);
17031702
AtEOXact_SPI(true);
1704-
AtEOXact_xml();
17051703
AtEOXact_on_commit_actions(true);
17061704
AtEOXact_Namespace(true);
17071705
/* smgrcommit already done */
@@ -1937,7 +1935,6 @@ PrepareTransaction(void)
19371935
/* PREPARE acts the same as COMMIT as far as GUC is concerned */
19381936
AtEOXact_GUC(true,1);
19391937
AtEOXact_SPI(true);
1940-
AtEOXact_xml();
19411938
AtEOXact_on_commit_actions(true);
19421939
AtEOXact_Namespace(true);
19431940
/* smgrcommit already done */
@@ -2082,7 +2079,6 @@ AbortTransaction(void)
20822079

20832080
AtEOXact_GUC(false,1);
20842081
AtEOXact_SPI(false);
2085-
AtEOXact_xml();
20862082
AtEOXact_on_commit_actions(false);
20872083
AtEOXact_Namespace(false);
20882084
AtEOXact_Files();
@@ -3919,7 +3915,6 @@ AbortSubTransaction(void)
39193915

39203916
AtEOXact_GUC(false,s->gucNestLevel);
39213917
AtEOSubXact_SPI(false,s->subTransactionId);
3922-
AtEOXact_xml();
39233918
AtEOSubXact_on_commit_actions(false,s->subTransactionId,
39243919
s->parent->subTransactionId);
39253920
AtEOSubXact_Namespace(false,s->subTransactionId,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp