summaryrefslogtreecommitdiff
path: root/lib/Exceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Exceptions.cc')
-rw-r--r--lib/Exceptions.cc22
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index 0376fee..3989836 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -9,24 +9,6 @@
char GeneralException::t[BUFSIZ];
-char * Base::strdup(const char * s) const {
- return xstrdup(s);
-}
-
-void * Base::malloc(ssize_t s) const {
- return xmalloc(s);
-}
-
-
-void * Base::operator new(size_t s) {
- return memset(xmalloc(s), 0, s);
-}
-
-void * Base::operator new(size_t s, void * p) {
- memset(p, 0, s);
- return p;
-}
-
GeneralException::GeneralException(String emsg) : msg(emsg.strdup()) { }
GeneralException::GeneralException() : msg(0) { }
GeneralException::GeneralException(const GeneralException & e) : msg(strdup(e.msg)) { }
@@ -75,10 +57,14 @@ void * xmalloc(ssize_t s) throw (MemoryException) {
throw MemoryException(s);
}
+ memset(r, 0, s);
+
return r;
}
+#ifdef OVER_FREE
#undef free
+#endif
void xfree(void *& p) {
if (p) {