summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-27 19:45:15 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-27 19:45:15 -0800
commit9071077cbb2d4c986a456127a206e82e4e8ddbfd (patch)
tree32b2ffe1797ab88b402780f7a8d2d439ca93bdd1
parentc86427824feb6377275b12c9f5b656b964787f56 (diff)
Protecting allocation functions further into a namespace.
-rw-r--r--includes/Exceptions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/Exceptions.h b/includes/Exceptions.h
index 799bfb6..53c4949 100644
--- a/includes/Exceptions.h
+++ b/includes/Exceptions.h
@@ -1,6 +1,7 @@
#pragma once
#include <stdarg.h>
+#include <stdlib.h>
#include <typeinfo>
#include <functional>
@@ -65,6 +66,8 @@ class RessourceException : public GeneralException {
void ExitHelper(const String & msg, const char * fmt = NULL, ...) printfwarning(2, 3);
+namespace Alloc {
+
static inline void * malloc(size_t size) {
void * r = ::malloc(size);
@@ -92,6 +95,8 @@ static inline void * realloc(void * previous, size_t size) {
return r;
}
+};
+
static inline void AssertHelperInner(const String & msg, const char * details = NULL) throw (GeneralException) {
#if defined(_MSC_VER) && defined(DEBUG)
__debugbreak();