mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-11 00:56:37 +00:00
Reserve some space in the checkpoints vector
This commit is contained in:
parent
f954013d0b
commit
c7041d6e97
@ -35,7 +35,7 @@ static constexpr SerializeCompressType SAVE_TYPE = SerializeCompressType::ZSTD;
|
||||
|
||||
void PointerWrap::RewindForWrite(u8 *writePtr) {
|
||||
_assert_(mode == MODE_MEASURE);
|
||||
// Switch to writing mode and
|
||||
// Switch to writing mode, save the size for later checking and start again.
|
||||
measuredSize_ = Offset();
|
||||
mode = MODE_WRITE;
|
||||
*ptr = writePtr;
|
||||
|
@ -111,8 +111,11 @@ public:
|
||||
Mode mode;
|
||||
Error error = ERROR_NONE;
|
||||
|
||||
PointerWrap(u8 **ptr_, Mode mode_) : ptr(ptr_), ptrStart_(*ptr), mode(mode_) {}
|
||||
PointerWrap(unsigned char **ptr_, int mode_) : ptr((u8**)ptr_), ptrStart_(*ptr), mode((Mode)mode_) {}
|
||||
PointerWrap(u8 **ptr_, Mode mode_) : ptr(ptr_), ptrStart_(*ptr), mode(mode_) {
|
||||
if (mode == MODE_MEASURE) {
|
||||
checkpoints_.reserve(750);
|
||||
}
|
||||
}
|
||||
|
||||
void RewindForWrite(u8 *writePtr);
|
||||
bool CheckAfterWrite();
|
||||
@ -143,7 +146,6 @@ public:
|
||||
size_t Offset() const { return *ptr - ptrStart_; }
|
||||
|
||||
private:
|
||||
|
||||
const char *firstBadSectionTitle_ = nullptr;
|
||||
u8 *ptrStart_;
|
||||
std::vector<SerializeCheckpoint> checkpoints_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user