summaryrefslogtreecommitdiff
path: root/lib/Exceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Exceptions.cc')
-rw-r--r--lib/Exceptions.cc54
1 files changed, 53 insertions, 1 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index b183b55..c46dcfc 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -93,7 +93,7 @@ char * xstrdup(const char * s) {
void * xmalloc(size_t s) throw (GeneralException) {
char * r;
- if (!s) {
+ if (s == 0) {
return 0;
}
@@ -160,3 +160,55 @@ pid_t xfork() throw (GeneralException) {
void xexit(int status) throw (GeneralException) {
throw Exit(status);
}
+
+char * Base::strdup(const char * s) {
+ return xstrdup(s);
+}
+
+void * Base::malloc(ssize_t s) {
+ return xmalloc(s);
+}
+
+void * Base::realloc(void * p, size_t s) {
+ return xrealloc(p, s);
+}
+
+void * Base::calloc(size_t n, size_t s) {
+ return xmalloc(n * s);
+}
+
+void * Base::operator new(size_t s) {
+ return xmalloc(s);
+}
+
+void * Base::operator new(size_t s, void * p) {
+ return memset(p, 0, s);
+}
+
+void Base::operator delete(void * p) {
+ xfree(p);
+}
+
+void Base::free(void *& p) {
+ xfree(p);
+}
+
+void Base::free(char *& p) {
+ xfree(p);
+}
+
+void Base::free(unsigned char *& p) {
+ xfree(p);
+}
+
+int Base::pipe(int * p, int flag) {
+ return xpipe(p, flag);
+}
+
+pid_t Base::fork() {
+ return xfork();
+}
+
+void Base::exit(int status) {
+ xexit(status);
+}