diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-05-11 12:20:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-05-11 12:20:11 +0200 |
commit | 2e501c68a8641a2b3c430b55f13491a9c1c5d0f5 (patch) | |
tree | 49c2748443fe3c1f01108756b647440e0647a11b /libxsde/xsde/cxx/allocator.ixx | |
parent | 161beba6cdb0d91b15ad19fa8b3e51d986203915 (diff) |
Add support for custom allocators
New example: examples/cxx/hybrid/allocator.
Diffstat (limited to 'libxsde/xsde/cxx/allocator.ixx')
-rw-r--r-- | libxsde/xsde/cxx/allocator.ixx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/allocator.ixx b/libxsde/xsde/cxx/allocator.ixx new file mode 100644 index 0000000..9f3d50b --- /dev/null +++ b/libxsde/xsde/cxx/allocator.ixx @@ -0,0 +1,27 @@ +// file : xsde/cxx/allocator.ixx +// 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/allocator.h> + +namespace xsde +{ + namespace cxx + { +#ifndef XSDE_EXCEPTIONS + inline void* + alloc (size_t n) + { + return xsde_alloc (n); + } +#endif + + inline void + free (void* p) + { + if (p) + xsde_free (p); + } + } +} |