summaryrefslogtreecommitdiff
path: root/src/include/utils/xml.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-05-13 20:27:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-05-13 20:27:17 +0000
commit23543c732b7dae41bb7904e2baf02da9a5a51d8d (patch)
tree87a8d8e98c3019fea708ab3ec55d059a8527409d /src/include/utils/xml.h
parentdb6e0b2db23efe1a23e81aa69f1d431c71b38d9b (diff)
Rewrite xml.c's memory management (yet again). Give up on the idea of
redirecting libxml's allocations into a Postgres context. Instead, just let it use malloc directly, and add PG_TRY blocks as needed to be sure we release libxml data structures in error recovery code paths. This is ugly but seems much more likely to play nicely with third-party uses of libxml, as seen in recent 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 only built/used if you #define USE_LIBXMLCONTEXT. This is because I found it useful to corral libxml's allocations in a palloc context when hunting for libxml memory leaks, and we're surely going to have more of those in the future with this type of approach. But we don't want it turned on in 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 wrapped by 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 change until it's gotten a reasonable amount of field testing.
Diffstat (limited to 'src/include/utils/xml.h')
-rw-r--r--src/include/utils/xml.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/include/utils/xml.h b/src/include/utils/xml.h
index e2881ee8dbb..f11ec721c48 100644
--- a/src/include/utils/xml.h
+++ b/src/include/utils/xml.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.25 2009/01/01 17:24:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.26 2009/05/13 20:27:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,8 +75,6 @@ extern char *map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, boo
extern char *map_xml_name_to_sql_identifier(char *name);
extern char *map_sql_value_to_xml_value(Datum value, Oid type);
-extern void AtEOXact_xml(void);
-
typedef enum
{
XMLBINARY_BASE64,