aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/parser/expat/document.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-05-11 12:20:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-05-11 12:20:11 +0200
commit2e501c68a8641a2b3c430b55f13491a9c1c5d0f5 (patch)
tree49c2748443fe3c1f01108756b647440e0647a11b /libxsde/xsde/cxx/parser/expat/document.cxx
parent161beba6cdb0d91b15ad19fa8b3e51d986203915 (diff)
Add support for custom allocators
New example: examples/cxx/hybrid/allocator.
Diffstat (limited to 'libxsde/xsde/cxx/parser/expat/document.cxx')
-rw-r--r--libxsde/xsde/cxx/parser/expat/document.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/parser/expat/document.cxx b/libxsde/xsde/cxx/parser/expat/document.cxx
index 61cc1d0..84cf7f8 100644
--- a/libxsde/xsde/cxx/parser/expat/document.cxx
+++ b/libxsde/xsde/cxx/parser/expat/document.cxx
@@ -17,6 +17,10 @@
# include <fstream>
#endif
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
#ifdef XSDE_ENCODING_ISO8859_1
# include <xsde/cxx/iso8859-1.hxx>
#endif
@@ -1291,7 +1295,11 @@ namespace xsde
buf = data_buf_;
else
{
+#ifndef XSDE_CUSTOM_ALLOCATOR
buf = new char[iso_n];
+#else
+ buf = static_cast<char*> (alloc (iso_n));
+#endif
#ifndef XSDE_EXCEPTIONS
if (buf == 0)
@@ -1324,7 +1332,11 @@ namespace xsde
buf = data_buf_;
else
{
+#ifndef XSDE_CUSTOM_ALLOCATOR
buf = new char[iso_n];
+#else
+ buf = static_cast<char*> (alloc (iso_n));
+#endif
#ifndef XSDE_EXCEPTIONS
if (buf == 0)
@@ -1354,7 +1366,11 @@ namespace xsde
buf = name_buf_;
else
{
+#ifndef XSDE_CUSTOM_ALLOCATOR
buf = new char[iso_n];
+#else
+ buf = static_cast<char*> (alloc (iso_n));
+#endif
#ifndef XSDE_EXCEPTIONS
if (buf == 0)