Unverified Commit 742abcd9 authored by Alexander Entinger's avatar Alexander Entinger Committed by GitHub

Merge pull request #33 from Pharap/add-placement-new

Add placement new operator
parents ffe7ae05 6a717473
...@@ -26,6 +26,11 @@ void *operator new[](size_t size) { ...@@ -26,6 +26,11 @@ void *operator new[](size_t size) {
return malloc(size); return malloc(size);
} }
void * operator new(size_t size, void * ptr) noexcept {
(void)size;
return ptr;
}
void operator delete(void * ptr) { void operator delete(void * ptr) {
free(ptr); free(ptr);
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
void * operator new(size_t size); void * operator new(size_t size);
void * operator new[](size_t size); void * operator new[](size_t size);
void * operator new(size_t size, void * ptr) noexcept;
void operator delete(void * ptr); void operator delete(void * ptr);
void operator delete[](void * ptr); void operator delete[](void * ptr);
......
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