Implement native versions of AllocateFileRange() for:
- Linux: posix_fallocate()
- Mac OSX: fcntl(..., F_PREALLOCATE, ...)
- Windows: SetEndOfFile()
This should prevent the double-writing fallback that is used currently.
Implement native versions of AllocateFileRange() for:
This should prevent the double-writing fallback that is used currently.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/f92555255c2d928ce618d383aa5da46bd195ef43 for binaries and test log.
Test plan: either (1) start syncing from scratch or (2) delete the blocks/rev* files and start a -reindex. In both cases, at any point in time, should the filesize of the blk* files be a multiple of 16 MiB and the rev* files a multiple of 1 MiB.
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/2d5e0349e19eec9b4c322cdeab37cb0019551fb6 for binaries and test log.
The test succeeded under OS X Version 10.8.2
Reindex test passes on Fedora 16/17. Needs windows testing.
This is just an optimization, yes?
I think it can wait for 0.8.1.
Indeed an optimization, but one that is easy to test. Ok for 0.8.1.
Nit: use #elif
ACK
Added a commit to drop the pre-allocated padding when finalizing a block file (=moving to a next one).
ah, good to not waste 30MiB...
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/1eb578796c98f457546059b66eb98fd0efc8e690 for binaries and test log.
ACK