Remove: AutoFreeSmallVector.
The last use was for storing a list of memory blocks. As the way these lists are accessed is very specific, it is easier to just write an explicit destructor instead of trying to exactly match the behaviour.
This commit is contained in:
@@ -126,15 +126,22 @@ struct ReadBuffer {
|
||||
|
||||
/** Container for dumping the savegame (quickly) to memory. */
|
||||
struct MemoryDumper {
|
||||
AutoFreeSmallVector<byte *> blocks; ///< Buffer with blocks of allocated memory.
|
||||
byte *buf; ///< Buffer we're going to write to.
|
||||
byte *bufe; ///< End of the buffer we write to.
|
||||
std::vector<byte *> blocks; ///< Buffer with blocks of allocated memory.
|
||||
byte *buf; ///< Buffer we're going to write to.
|
||||
byte *bufe; ///< End of the buffer we write to.
|
||||
|
||||
/** Initialise our variables. */
|
||||
MemoryDumper() : buf(NULL), bufe(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
~MemoryDumper()
|
||||
{
|
||||
for (auto p : this->blocks) {
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a single byte into the dumper.
|
||||
* @param b The byte to write.
|
||||
|
Reference in New Issue
Block a user