I am trying to use my own RAMPool to solve fragmentation issue, but there's a vendor library that I don't have the source code(only the header and so). I tried to do the following but it doesn't seem to work for that vendor lib, however it does work if I allocate a std::string or my own class etc. What did I miss?
void* operator new(std::size_t t) throw (std::bad_alloc)
{
//call my RAMPool
return p ;
}
void* operator new[](std::size_t t) throw (std::bad_alloc)
{
//call my RAMPool
return p ;
}
void operator delete(void* p) throw()
{
//call my RAMPool
}
void operator delete[](void* p) throw()
{
//call my RAMPool
}