Permalink
Browse files

Backport breakpoint/crash fix in bindsocket in win32 (missing operato…

…r new[] and operator delete[]

git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@9544 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information...
braindigitalis committed Apr 19, 2008
1 parent a7e77a6 commit 0a51637e41404ffcac130f2eee1ab6752a099259
Showing with 18 additions and 0 deletions.
  1. +18 −0 win/inspircd_memory_functions.cpp
@@ -42,3 +42,21 @@ void ::operator delete(void * ptr)
{
HeapFree(GetProcessHeap(), 0, ptr);
}
void * ::operator new[] (size_t iSize)
{
void* ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iSize); /* zero memory for unix compatibility */
/* This is the correct behaviour according to C++ standards for out of memory,
* not returning null -- Brain
*/
if (!ptr)
throw std::bad_alloc();
else
return ptr;
}
void ::operator delete[] (void * ptr)
{
HeapFree(GetProcessHeap(), 0, ptr);
}

0 comments on commit 0a51637

Please sign in to comment.