diff options
author | lloyd <[email protected]> | 2008-09-14 03:42:03 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-14 03:42:03 +0000 |
commit | de02c2fe44ad7ce5ead3967c22aa689da508eaa0 (patch) | |
tree | 9796295c7c69c432417de271d9877ef2c5c4bd97 /src | |
parent | fc2fbc643aa77f25761cd2f51362c024267c321e (diff) |
The Memory_Exhaustion exception was only thrown from mem_pool.cpp, so
move in there. Make it a subclass of std::bad_alloc instead of
Botan::Exception (this may prove to be a design mistake).
Diffstat (limited to 'src')
-rw-r--r-- | src/mem_pool.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 * *************************************************/ |