Upgrade Serialization acceleration compatibility with armv7 binary archives to arm64

The company I work for iOS and Android releases and now Apple requires us to update all of our apps to run on the arm64 architecture (previously we only released for armv7). Unfortunately we have used boost::archive::binary_iarchive

(s binary_oarchive

) to store a large amount of user data (saved games, preferences, etc.).

During testing, loading these archives, which were saved by the armv7 binary, now does not work on arm64 devices using the "Universal Binary" version of our games.

template<typename T>
static T Deserialize(std::vector<char> buffer) {
    boost::iostreams::basic_array_source<char> source(&buffer[0], buffer.size());
    boost::iostreams::stream<boost::iostreams::basic_array_source<char>> input_stream(source);
    boost::archive::binary_iarchive ia(input_stream); // crashes here
    T value;
    ia >> BOOST_SERIALIZATION_NVP(value);
    return value;
}

      

The buffer we are passing in is a reasonable size. Based on the fact that it crashes during the constructor boost::archive::binary_iarchive

, my guess is that it does not read the header correctly.

This is the error that is being logged:

(2005,0x19a1c0310) malloc: *** mach_vm_map(size=7598247065923108864) failed (error code=3)
*** error: can't allocate region

      

Is there any way to update and save saved user data?

+3


source to share


1 answer


If you need to preserve user data, you have to redesign your path from hell. Perhaps you can cheat if the old data is sent to the server for conversion.

For portable archives, you can try OES Portable Archive .



It is supposed to be a replacement for the standard binary archives and become truly portable. Of course, the results will not be binary compatible with the old format, so this is just a decision in the future.

+1


source







All Articles