aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/serializer/non-validating
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/serializer/non-validating
parent161beba6cdb0d91b15ad19fa8b3e51d986203915 (diff)
Add support for custom allocators
New example: examples/cxx/hybrid/allocator.
Diffstat (limited to 'libxsde/xsde/cxx/serializer/non-validating')
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/base64-binary.cxx24
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/hex-binary.cxx24
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/id.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/idref.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/idrefs-stl.cxx24
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx25
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/language.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/name.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/ncname.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/nmtoken.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/nmtokens-stl.cxx24
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/nmtokens.cxx25
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/normalized-string-stl.cxx1
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx23
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/qname.cxx24
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/string.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/token.cxx22
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/uri.cxx22
18 files changed, 337 insertions, 55 deletions
diff --git a/libxsde/xsde/cxx/serializer/non-validating/base64-binary.cxx b/libxsde/xsde/cxx/serializer/non-validating/base64-binary.cxx
index 89afb12..180823e 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/base64-binary.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/base64-binary.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/base64-binary.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
base64_binary_simpl::
~base64_binary_simpl ()
{
- if (free_)
- delete const_cast<buffer*> (value_);
+ if (free_ && value_)
+ {
+ buffer* v = const_cast<buffer*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~buffer ();
+ cxx::free (v);
+#endif
+ }
}
void base64_binary_simpl::
@@ -156,7 +168,13 @@ namespace xsde
if (free_)
{
- delete const_cast<buffer*> (value_);
+ buffer* v = const_cast<buffer*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~buffer ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/hex-binary.cxx b/libxsde/xsde/cxx/serializer/non-validating/hex-binary.cxx
index 9c5a49c..36d3e32 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/hex-binary.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/hex-binary.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/hex-binary.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
hex_binary_simpl::
~hex_binary_simpl ()
{
- if (free_)
- delete const_cast<buffer*> (value_);
+ if (free_ && value_)
+ {
+ buffer* v = const_cast<buffer*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~buffer ();
+ cxx::free (v);
+#endif
+ }
}
void hex_binary_simpl::
@@ -60,7 +72,13 @@ namespace xsde
if (free_)
{
- delete const_cast<buffer*> (value_);
+ buffer* v = const_cast<buffer*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~buffer ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/id.cxx b/libxsde/xsde/cxx/serializer/non-validating/id.cxx
index db50bef..ac7ede2 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/id.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/id.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/id.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
id_simpl::
~id_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void id_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/idref.cxx b/libxsde/xsde/cxx/serializer/non-validating/idref.cxx
index c4022e7..e52650f 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/idref.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/idref.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/idref.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
idref_simpl::
~idref_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void idref_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/idrefs-stl.cxx b/libxsde/xsde/cxx/serializer/non-validating/idrefs-stl.cxx
index ab48695..b95719a 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/idrefs-stl.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/idrefs-stl.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/idrefs-stl.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
idrefs_simpl::
~idrefs_simpl ()
{
- if (free_)
- delete const_cast<string_sequence*> (value_);
+ if (free_ && value_)
+ {
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
+ }
}
void idrefs_simpl::
@@ -91,7 +103,13 @@ namespace xsde
if (free_)
{
- delete const_cast<string_sequence*> (value_);
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx b/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx
index 11261a6..f812526 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/idrefs.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/idrefs.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
idrefs_simpl::
~idrefs_simpl ()
{
- if (free_)
- delete const_cast<string_sequence*> (value_);
+ if (free_ && value_)
+ {
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
+ }
}
void idrefs_simpl::
@@ -91,7 +103,13 @@ namespace xsde
if (free_)
{
- delete const_cast<string_sequence*> (value_);
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
@@ -106,4 +124,3 @@ namespace xsde
}
}
}
-
diff --git a/libxsde/xsde/cxx/serializer/non-validating/language.cxx b/libxsde/xsde/cxx/serializer/non-validating/language.cxx
index 72ccd8b..801aa3a 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/language.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/language.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/language.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
language_simpl::
~language_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void language_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/name.cxx b/libxsde/xsde/cxx/serializer/non-validating/name.cxx
index 851dcf9..6e8e0b1 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/name.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/name.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/name.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
name_simpl::
~name_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void name_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/ncname.cxx b/libxsde/xsde/cxx/serializer/non-validating/ncname.cxx
index 3c86986..eee9d60 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/ncname.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/ncname.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/ncname.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
ncname_simpl::
~ncname_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void ncname_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/nmtoken.cxx b/libxsde/xsde/cxx/serializer/non-validating/nmtoken.cxx
index a384c04..8f153ff 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/nmtoken.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/nmtoken.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/nmtoken.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
nmtoken_simpl::
~nmtoken_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void nmtoken_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/nmtokens-stl.cxx b/libxsde/xsde/cxx/serializer/non-validating/nmtokens-stl.cxx
index 6636b33..7cea1f1 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/nmtokens-stl.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/nmtokens-stl.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/nmtokens-stl.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
nmtokens_simpl::
~nmtokens_simpl ()
{
- if (free_)
- delete const_cast<string_sequence*> (value_);
+ if (free_ && value_)
+ {
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
+ }
}
void nmtokens_simpl::
@@ -91,7 +103,13 @@ namespace xsde
if (free_)
{
- delete const_cast<string_sequence*> (value_);
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/nmtokens.cxx b/libxsde/xsde/cxx/serializer/non-validating/nmtokens.cxx
index ad40fc4..57afd8d 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/nmtokens.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/nmtokens.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/nmtokens.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
nmtokens_simpl::
~nmtokens_simpl ()
{
- if (free_)
- delete const_cast<string_sequence*> (value_);
+ if (free_ && value_)
+ {
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
+ }
}
void nmtokens_simpl::
@@ -91,7 +103,13 @@ namespace xsde
if (free_)
{
- delete const_cast<string_sequence*> (value_);
+ string_sequence* v = const_cast<string_sequence*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~string_sequence ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
@@ -106,4 +124,3 @@ namespace xsde
}
}
}
-
diff --git a/libxsde/xsde/cxx/serializer/non-validating/normalized-string-stl.cxx b/libxsde/xsde/cxx/serializer/non-validating/normalized-string-stl.cxx
index 5810de3..b5209c3 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/normalized-string-stl.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/normalized-string-stl.cxx
@@ -33,4 +33,3 @@ namespace xsde
}
}
}
-
diff --git a/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx b/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx
index b1bbf29..202ac76 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/normalized-string.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/normalized-string.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
normalized_string_simpl::
~normalized_string_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void normalized_string_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
@@ -41,4 +57,3 @@ namespace xsde
}
}
}
-
diff --git a/libxsde/xsde/cxx/serializer/non-validating/qname.cxx b/libxsde/xsde/cxx/serializer/non-validating/qname.cxx
index 19c7daa..ec267ef 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/qname.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/qname.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/qname.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,16 @@ namespace xsde
qname_simpl::
~qname_simpl ()
{
- if (free_)
- delete const_cast<qname*> (value_);
+ if (free_ && value_)
+ {
+ qname* v = const_cast<qname*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~qname ();
+ cxx::free (v);
+#endif
+ }
}
void qname_simpl::
@@ -52,7 +64,13 @@ namespace xsde
if (free_)
{
- delete const_cast<qname*> (value_);
+ qname* v = const_cast<qname*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete v;
+#else
+ v->~qname ();
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/string.cxx b/libxsde/xsde/cxx/serializer/non-validating/string.cxx
index 7b1e546..1c6c50f 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/string.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/string.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/string.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
string_simpl::
~string_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void string_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/token.cxx b/libxsde/xsde/cxx/serializer/non-validating/token.cxx
index 5ff0739..2af141c 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/token.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/token.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/token.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
token_simpl::
~token_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void token_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}
diff --git a/libxsde/xsde/cxx/serializer/non-validating/uri.cxx b/libxsde/xsde/cxx/serializer/non-validating/uri.cxx
index 43bafbd..5640302 100644
--- a/libxsde/xsde/cxx/serializer/non-validating/uri.cxx
+++ b/libxsde/xsde/cxx/serializer/non-validating/uri.cxx
@@ -5,6 +5,10 @@
#include <xsde/cxx/serializer/non-validating/uri.hxx>
+#ifdef XSDE_CUSTOM_ALLOCATOR
+# include <xsde/cxx/allocator.hxx>
+#endif
+
namespace xsde
{
namespace cxx
@@ -16,8 +20,15 @@ namespace xsde
uri_simpl::
~uri_simpl ()
{
- if (free_)
- delete[] const_cast<char*> (value_);
+ if (free_ && value_)
+ {
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
+ }
}
void uri_simpl::
@@ -33,7 +44,12 @@ namespace xsde
if (free_)
{
- delete[] const_cast<char*> (value_);
+ char* v = const_cast<char*> (value_);
+#ifndef XSDE_CUSTOM_ALLOCATOR
+ delete[] v;
+#else
+ cxx::free (v);
+#endif
value_ = 0;
}
}