Build system improvements
[ustl.git] / unew.cc
blobc70533cbb506c026e2d3a057132a8370cbff0826
1 // This file is part of the ustl library, an STL implementation.
2 //
3 // Copyright (C) 2005 by Mike Sharov <msharov@users.sourceforge.net>
4 // This file is free software, distributed under the MIT License.
5 //
6 // unew.cc
7 //
9 #include "unew.h"
10 #include <stdlib.h>
12 void* throwing_malloc (size_t n) throw (ustl::bad_alloc)
14 void* p = malloc (n);
15 if (!p)
16 throw ustl::bad_alloc (n);
17 return (p);
20 void free_nullok (void* p) throw()
22 if (p)
23 free (p);