C++ allows overloading operator new
- both global and per-class - usual operator new
, operator new[]
used with new[]
stat
To define your own memory management for a prereserved area is one nice use.
To have different views on the same physical data (no need to move the data) is other interseting use. It also allows you reading a structured file as chars on a buffer and then, the superimposition of the their logical structure by defining an object of that the class over the buffer. The combination of this thing with the memory mapping of files, can provide big improvements in performance. The memory mapped hardware... So, thousand applications!