From e5a82da26e29560f3e7121b600a12f8acd6a5a3f Mon Sep 17 00:00:00 2001 From: Jordi Vaquero Date: Wed, 11 Sep 2019 00:11:27 +0200 Subject: cpu, mem: Changing AtomicOpFunctor* for unique_ptr This change is based on modify the way we move the AtomicOpFunctor* through gem5 in order to mantain proper ownership of the object and ensuring its destruction when it is no longer used. Doing that we fix at the same time a memory leak in Request.hh where we were assigning a new AtomicOpFunctor* without destroying the previous one. This change creates a new type AtomicOpFunctor_ptr as a std::unique_ptr and move its ownership as needed. Except for its only usage when AtomicOpFunc() is called. Change-Id: Ic516f9d8217cb1ae1f0a19500e5da0336da9fd4f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20919 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/cpu/checker/cpu.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cpu/checker') diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh index 440fe81b5..8db6aa376 100644 --- a/src/cpu/checker/cpu.hh +++ b/src/cpu/checker/cpu.hh @@ -565,7 +565,7 @@ class CheckerCPU : public BaseCPU, public ExecContext override; Fault amoMem(Addr addr, uint8_t* data, unsigned size, - Request::Flags flags, AtomicOpFunctor *amo_op) override + Request::Flags flags, AtomicOpFunctorPtr amo_op) override { panic("AMO is not supported yet in CPU checker\n"); } -- cgit v1.2.3