Commit 6e0fb1ee authored by Matthijs Kooijman's avatar Matthijs Kooijman

Make zero-sized new standards-compliant

This fixes part of #287.
parent 66d06b03
......@@ -23,6 +23,10 @@ namespace std {
}
void * operator new(size_t size) {
// Even zero-sized allocations should return a unique pointer, but
// malloc does not guarantee this
if (size == 0)
size = 1;
return malloc(size);
}
void * operator new[](size_t size) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment