mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 12:00:03 +00:00
code: Remove save state compatibility checks (#6980)
This commit is contained in:
parent
542209c993
commit
d1c16bad78
13 changed files with 52 additions and 115 deletions
|
@ -79,29 +79,13 @@ private:
|
|||
void WakeUp(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
|
||||
std::shared_ptr<WaitObject> object) override;
|
||||
|
||||
class DummyCallback : public WakeupCallback {
|
||||
public:
|
||||
void WakeUp(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
|
||||
std::shared_ptr<WaitObject> object) override {}
|
||||
};
|
||||
|
||||
friend class boost::serialization::access;
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int file_version) {
|
||||
ar& boost::serialization::base_object<Object>(*this);
|
||||
if (file_version == 1) {
|
||||
// This rigmarole is needed because in past versions, AddressArbiter inherited
|
||||
// WakeupCallback But it turns out this breaks shared_from_this, so we split it out.
|
||||
// Using a dummy class to deserialize a base_object allows compatibility to be
|
||||
// maintained.
|
||||
DummyCallback x;
|
||||
ar& boost::serialization::base_object<WakeupCallback>(x);
|
||||
}
|
||||
ar& name;
|
||||
ar& waiting_threads;
|
||||
if (file_version > 1) {
|
||||
ar& timeout_callback;
|
||||
}
|
||||
ar& timeout_callback;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -45,16 +45,7 @@ void Thread::serialize(Archive& ar, const unsigned int file_version) {
|
|||
ar& tls_address;
|
||||
ar& held_mutexes;
|
||||
ar& pending_mutexes;
|
||||
|
||||
// Note: this is equivalent of what is done in boost/serialization/weak_ptr.hpp, but it's
|
||||
// compatible with previous versions of savestates.
|
||||
// TODO(SaveStates): When the savestate version is bumped, simplify this again.
|
||||
std::shared_ptr<Process> shared_owner_process = owner_process.lock();
|
||||
ar& shared_owner_process;
|
||||
if (Archive::is_loading::value) {
|
||||
owner_process = shared_owner_process;
|
||||
}
|
||||
|
||||
ar& owner_process;
|
||||
ar& wait_objects;
|
||||
ar& wait_address;
|
||||
ar& name;
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
#include <vector>
|
||||
#include <boost/container/flat_set.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <boost/serialization/unordered_map.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include <boost/serialization/weak_ptr.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/thread_queue_list.h"
|
||||
#include "core/arm/arm_interface.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue