aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-03-16 12:32:06 +0000
committerGravatar Sadie Powell2025-03-16 12:40:49 +0000
commitf320ea9087f162a62440aa72116393dd9415f89a (patch)
tree7c4cc0f6aab40b815673aa39f8678f51507eff3e
parentAdd support for ModLink directives in modulemanager. (diff)
Update win32memory to comply with the InspIRCd coding standards.
[skip alpine ci] [skip irctest ci] [skip macos ci] [skip ubuntu ci]
-rw-r--r--win/win32memory.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/win/win32memory.cpp b/win/win32memory.cpp
index 5b5284aee..5bdc37c87 100644
--- a/win/win32memory.cpp
+++ b/win/win32memory.cpp
@@ -24,9 +24,7 @@
*/
-#include <exception>
#include <new>
-
#include <windows.h>
/** On windows, all dll files and executables have their own private heap,
@@ -39,31 +37,26 @@
* when it comes to memory usage between dlls and exes.
*/
-void * ::operator new(size_t iSize)
+void* ::operator new(size_t count)
{
- void* ptr = HeapAlloc(GetProcessHeap(), 0, iSize);
- /* This is the correct behaviour according to C++ standards for out of memory,
- * not returning null -- Brain
- */
+ void* ptr = HeapAlloc(GetProcessHeap(), 0, count);
if (!ptr)
throw std::bad_alloc();
- else
- return ptr;
+ return ptr;
}
-void ::operator delete(void * ptr)
+void ::operator delete(void* ptr)
{
if (ptr)
HeapFree(GetProcessHeap(), 0, ptr);
}
-void * operator new[] (size_t iSize)
+void* operator new[](size_t count)
{
- void* ptr = HeapAlloc(GetProcessHeap(), 0, iSize);
+ void* ptr = HeapAlloc(GetProcessHeap(), 0, count);
if (!ptr)
throw std::bad_alloc();
- else
- return ptr;
+ return ptr;
}
void operator delete[] (void* ptr)