fork(1) download
  1. #include <iostream>
  2.  
  3. class SimpleMemoryPool{
  4. };
  5.  
  6. void* operator new(size_t n, SimpleMemoryPool* pool)
  7. {
  8. void *tmp = ::operator new(n);
  9. return tmp;
  10. }
  11.  
  12. int main()
  13. {
  14. SimpleMemoryPool *m_Pool;
  15. float *signalGen = new (m_Pool) float[100];
  16. delete[] signalGen;
  17. std::cout << signalGen << std::endl;
  18. }
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
0