diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/configureVC80.vcproj | 2 | ||||
-rw-r--r-- | win/inspircd_memory_functions.cpp | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/win/configureVC80.vcproj b/win/configureVC80.vcproj index 8b4399e6b..e46cad94e 100644 --- a/win/configureVC80.vcproj +++ b/win/configureVC80.vcproj @@ -128,7 +128,7 @@ RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
- Detect64BitPortabilityProblems="true"
+ Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
diff --git a/win/inspircd_memory_functions.cpp b/win/inspircd_memory_functions.cpp index 1f269e000..c48c833dc 100644 --- a/win/inspircd_memory_functions.cpp +++ b/win/inspircd_memory_functions.cpp @@ -28,7 +28,7 @@ void * ::operator new(size_t iSize) { - void* ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iSize); /* zero memory for unix compatibility */ + void* ptr = HeapAlloc(GetProcessHeap(), 0, iSize); /* zero memory for unix compatibility */ /* This is the correct behaviour according to C++ standards for out of memory, * not returning null -- Brain */ @@ -42,3 +42,16 @@ void ::operator delete(void * ptr) { HeapFree(GetProcessHeap(), 0, ptr); } + +void * operator new[] (size_t iSize) { + void* ptr = HeapAlloc(GetProcessHeap(), 0, iSize); /* Why were we initializing the memory to zeros here? This is just a waste of cpu! */ + if (!ptr) + throw std::bad_alloc(); + else + return ptr; +} + +void operator delete[] (void* ptr) +{ + HeapFree(GetProcessHeap(), 0, ptr); +} |