]> www.ginac.de Git - cln.git/blobdiff - src/base/cl_malloc.cc
Cater to the fact that g++ 4.3 will use a different naming for
[cln.git] / src / base / cl_malloc.cc
index 4ca4fc3ff0d4ce75baaa67e81df7e31438711895..981254e3e8780f680d49dc61b0a2d071fa19bf98 100644 (file)
@@ -9,9 +9,9 @@
 
 // Implementation.
 
-#include <stdlib.h>
+#include <cstdlib>
 #include "cln/io.h"
-#include "cln/abort.h"
+#include "cln/exception.h"
 
 #ifndef malloc
   extern "C" void* malloc (size_t size);
@@ -28,8 +28,7 @@ static void* xmalloc (size_t size)
        void* ptr = malloc(size);
        if (ptr)
                return ptr;
-       fprint(std::cerr, "Out of virtual memory.\n");
-       cl_abort();
+       throw runtime_exception("Out of virtual memory.");
 }
 
 void* (*malloc_hook) (size_t size) = xmalloc;