sim: Remove (UN)SERIALIZE_OBJ_PTR
SimObjects keep a static list with all existing SimObjects. This list is then used to serialize all objects declared in the system. If these macros were used then an object would be serialized more than once, which is not a correct behavior. Change-Id: Idc4433ec2a23a21ee5ee2b7cc2facfe3dd979859 Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46720 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
committed by
Daniel Carvalho
parent
19c7429520
commit
18de63cea0
@@ -654,25 +654,6 @@ mappingParamIn(CheckpointIn &cp, const char* sectionName,
|
||||
*/
|
||||
#define UNSERIALIZE_OBJ(obj) obj.unserializeSection(cp, #obj)
|
||||
|
||||
/**
|
||||
* \def SERIALIZE_OBJPTR(objptr)
|
||||
*
|
||||
* @ingroup api_serialize
|
||||
*/
|
||||
#define SERIALIZE_OBJPTR(objptr) paramOut(cp, #objptr, (objptr)->name())
|
||||
|
||||
/**
|
||||
* \def UNSERIALIZE_OBJPTR(objptr)
|
||||
*
|
||||
* @ingroup api_serialize
|
||||
*/
|
||||
#define UNSERIALIZE_OBJPTR(objptr) \
|
||||
do { \
|
||||
SimObject *sptr; \
|
||||
objParamIn(cp, #objptr, sptr); \
|
||||
objptr = dynamic_cast<decltype(objptr)>(sptr); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* \def SERIALIZE_MAPPING(member, names, size)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user