aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/string.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/string.cxx')
-rw-r--r--libxsde/xsde/cxx/string.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/string.cxx b/libxsde/xsde/cxx/string.cxx
index 5284220..02c8d04 100644
--- a/libxsde/xsde/cxx/string.cxx
+++ b/libxsde/xsde/cxx/string.cxx
@@ -56,7 +56,11 @@ namespace xsde
else
new_cap += (new_cap & 1) ? 1 : 0; // Make even.
+#ifndef XSDE_CUSTOM_ALLOCATOR
char* p = new char[new_cap];
+#else
+ char* p = static_cast<char*> (alloc (new_cap));
+#endif
if (p == 0)
return error_no_memory;
@@ -64,7 +68,11 @@ namespace xsde
if (copy && size_ != 0)
memcpy (p, data_, size_ + 1);
+#ifndef XSDE_CUSTOM_ALLOCATOR
delete[] data_;
+#else
+ cxx::free (data_);
+#endif
data_ = p;
capacity_ = new_cap;