- Notifications
You must be signed in to change notification settings - Fork5
Commit23543c7
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
3 files changed
+179
-113
lines changedLines changed: 1 addition & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
53 | 52 |
| |
54 | 53 |
| |
55 | 54 |
| |
| |||
1701 | 1700 |
| |
1702 | 1701 |
| |
1703 | 1702 |
| |
1704 |
| - | |
1705 | 1703 |
| |
1706 | 1704 |
| |
1707 | 1705 |
| |
| |||
1937 | 1935 |
| |
1938 | 1936 |
| |
1939 | 1937 |
| |
1940 |
| - | |
1941 | 1938 |
| |
1942 | 1939 |
| |
1943 | 1940 |
| |
| |||
2082 | 2079 |
| |
2083 | 2080 |
| |
2084 | 2081 |
| |
2085 |
| - | |
2086 | 2082 |
| |
2087 | 2083 |
| |
2088 | 2084 |
| |
| |||
3919 | 3915 |
| |
3920 | 3916 |
| |
3921 | 3917 |
| |
3922 |
| - | |
3923 | 3918 |
| |
3924 | 3919 |
| |
3925 | 3920 |
| |
|
0 commit comments
Comments
(0)