aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-01-05 23:06:31 +0000
committerlloyd <[email protected]>2010-01-05 23:06:31 +0000
commit2837e915d82e439730624f15bfc8c820475c9d65 (patch)
treeaeb1ec26572fb29c1bd60baab582699279201d71 /src/alloc
parent968a4250218d40f3da9eee8ff50432a3169605c6 (diff)
Clean up exceptions. Remove some unused ones like Config_Error. Make
Invalid_Argument just a typedef for std::invalid_argument. Make Botan::Exception a typedef for std::runtime_error. Make Memory_Exhaustion a public exception, and use it in other places where memory allocations can fail.
Diffstat (limited to 'src/alloc')
-rw-r--r--src/alloc/mem_pool/mem_pool.cpp13
-rw-r--r--src/alloc/system_alloc/defalloc.cpp2
2 files changed, 1 insertions, 14 deletions
diff --git a/src/alloc/mem_pool/mem_pool.cpp b/src/alloc/mem_pool/mem_pool.cpp
index 2945a4cef..4180d2602 100644
--- a/src/alloc/mem_pool/mem_pool.cpp
+++ b/src/alloc/mem_pool/mem_pool.cpp
@@ -15,19 +15,6 @@
namespace Botan {
-namespace {
-
-/*
-* Memory Allocation Exception
-*/
-struct Memory_Exhaustion : public std::bad_alloc
- {
- const char* what() const throw()
- { return "Ran out of memory, allocation failed"; }
- };
-
-}
-
/*
* Memory_Block Constructor
*/
diff --git a/src/alloc/system_alloc/defalloc.cpp b/src/alloc/system_alloc/defalloc.cpp
index faaeb3c58..311057462 100644
--- a/src/alloc/system_alloc/defalloc.cpp
+++ b/src/alloc/system_alloc/defalloc.cpp
@@ -94,7 +94,7 @@ Allocator* Allocator::get(bool locking)
if(alloc)
return alloc;
- throw Exception("Couldn't find an allocator to use in get_allocator");
+ throw Internal_Error("Couldn't find an allocator to use in get_allocator");
}
}