diff options
Diffstat (limited to 'libxsde/xsde/cxx/allocator.cxx')
-rw-r--r-- | libxsde/xsde/cxx/allocator.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/allocator.cxx b/libxsde/xsde/cxx/allocator.cxx new file mode 100644 index 0000000..0e7fb79 --- /dev/null +++ b/libxsde/xsde/cxx/allocator.cxx @@ -0,0 +1,26 @@ +// file : xsde/cxx/allocator.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsde/cxx/config.hxx> +#include <xsde/cxx/allocator.hxx> + +namespace xsde +{ + namespace cxx + { +#ifdef XSDE_EXCEPTIONS + void* + alloc (size_t n) + { + void* p = xsde_alloc (n); + + if (p == 0) + throw std::bad_alloc (); + + return p; + } +#endif + } +} |