Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHYSFS_flush() shouldn't call PHYSFS_Io::flush().
The former is meant to send PhysicsFS-buffered data to the PHYSFS_Io's implementation, the latter is meant to tell the OS to definitely make sure the data is safely written to disk (or at least, that's what it does in practice). This was making PHYSFS_setBuffer()'d handles _slower_, since they would end up blocking whenever the buffer was full until the data made the full trip to physical media, instead of just letting the OS do its own buffering. Now we still PHYSFS_Io::flush() on PHYSFS_close(), like this has always worked. That might also be overkill, but that remains a historical artifact of trying to keep the underlying file handle usable if pending writes fail for possibly-recoverable reasons (which isn't guaranteed if you just close() it, at least as far as I remember).
- Loading branch information