aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/allocator.cxx
blob: 2e35ff0313c2b4b3b1f2e920e78fd328bad9e4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// file      : xsde/cxx/allocator.cxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2005-2011 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
  }
}