Link Copied
[cpp]#include#include "tbb/scalable_allocator.h" void* operator new(std::size_t size) throw(std::bad_alloc) { if(void* ptr = scalable_malloc(size)) return ptr; else throw std::bad_alloc(); } void* operator new(std::size_t size, const std::nothrow_t&) throw() { return scalable_malloc(size); } void operator delete(void* ptr) throw() { scalable_free(ptr); } void operator delete(void* ptr, const std::nothrow_t&) throw() { scalable_free(ptr); } void* operator new[](std::size_t size) throw(std::bad_alloc) { if(void* ptr = scalable_malloc(size)) return ptr; else throw std::bad_alloc(); } void* operator new[](std::size_t size, const std::nothrow_t&) throw() { return scalable_malloc(size); } void operator delete[](void* ptr) throw() { scalable_free(ptr); } void operator delete[](void* ptr, const std::nothrow_t&) throw() { scalable_free(ptr); }[/cpp]
For more complete information about compiler optimizations, see our Optimization Notice.