aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/exceptn.h9
-rw-r--r--src/mem_pool.cpp14
2 files changed, 14 insertions, 9 deletions
diff --git a/include/exceptn.h b/include/exceptn.h
index 7bf486fa7..3bfec2fd2 100644
--- a/include/exceptn.h
+++ b/include/exceptn.h
@@ -190,15 +190,6 @@ struct BOTAN_DLL Self_Test_Failure : public Internal_Error
Internal_Error("Self test failed: " + err) {}
};
-/*************************************************
-* Memory Allocation Exception *
-*************************************************/
-struct BOTAN_DLL Memory_Exhaustion : public Exception
- {
- Memory_Exhaustion() :
- Exception("Ran out of memory, allocation failed") {}
- };
-
}
#endif
diff --git a/src/mem_pool.cpp b/src/mem_pool.cpp
index 4c2c30d25..74d09d5df 100644
--- a/src/mem_pool.cpp
+++ b/src/mem_pool.cpp
@@ -9,9 +9,23 @@
#include <botan/libstate.h>
#include <botan/util.h>
#include <algorithm>
+#include <exception>
namespace Botan {
+namespace {
+
+/*************************************************
+* Memory Allocation Exception *
+*************************************************/
+struct Memory_Exhaustion : public std::bad_alloc
+ {
+ const char* what()
+ { return "Ran out of memory, allocation failed"; }
+ };
+
+}
+
/*************************************************
* Memory_Block Constructor *
*************************************************/