diff options
Diffstat (limited to 'libxsde/xsde/cxx/strdupx.cxx')
-rw-r--r-- | libxsde/xsde/cxx/strdupx.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/strdupx.cxx b/libxsde/xsde/cxx/strdupx.cxx index 840bf3f..c9b68c4 100644 --- a/libxsde/xsde/cxx/strdupx.cxx +++ b/libxsde/xsde/cxx/strdupx.cxx @@ -8,6 +8,10 @@ #include <xsde/cxx/config.hxx> #include <xsde/cxx/strdupx.hxx> +#ifdef XSDE_CUSTOM_ALLOCATOR +# include <xsde/cxx/allocator.hxx> +#endif + namespace xsde { namespace cxx @@ -16,7 +20,12 @@ namespace xsde strdupx (const char* s) { size_t n = strlen (s); + +#ifndef XSDE_CUSTOM_ALLOCATOR char* r = new char[n + 1]; +#else + char* r = static_cast<char*> (alloc (n + 1)); +#endif #ifndef XSDE_EXCEPTIONS if (r) @@ -29,7 +38,11 @@ namespace xsde char* strndupx (const char* s, size_t n) { +#ifndef XSDE_CUSTOM_ALLOCATOR char* r = new char[n + 1]; +#else + char* r = static_cast<char*> (alloc (n + 1)); +#endif #ifndef XSDE_EXCEPTIONS if (r) |