#endif
+/**
+ * All classes intended to be allocated on dump memory should extend this
+ * base class to inherit the appropriate allocation operators.
+ */
+class DumpClass {
+public:
+ void* operator new(size_t size);
+ void operator delete(void* p);
+};
+
+
/**
* Thread-local dump memory structure.
*/
// Includes.
-#include "mm/memory.h"
+#include "mm/memory.hpp"
#include "threads/thread.hpp"
// Inline functions.
+inline void* DumpClass::operator new(size_t size)
+{
+ return DumpMemory::allocate(size);
+}
+
+inline void DumpClass::operator delete(void* p)
+{
+ // We don't need to deallocate on dump memory.
+}
+
inline DumpMemory* DumpMemory::get_current()
{
// Get the DumpMemory object of the current thread.