diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-06-11 03:44:36 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-06-11 03:54:45 +0200 |
commit | 72b27e12283699c9f2116dd6a5ce4c9bbe5b31d1 (patch) | |
tree | 12b1939f57560bcaaa93210bf23e41e9e15540dc /crawl-ref/source/package.h | |
parent | ed9508da27c3ef0803bfd1e600465a5eb6566441 (diff) | |
download | crawl-ref-72b27e12283699c9f2116dd6a5ce4c9bbe5b31d1.tar.gz crawl-ref-72b27e12283699c9f2116dd6a5ce4c9bbe5b31d1.zip |
Do the whole of X[] save handling as one transaction.
Actually, not even one as it won't be committed until the next time you go
to a new level. Subsequent writes of a given level in a transaction
overwrite the old uncommitted version.
This sadly can double the size of saves, if someone views all existing levels
in a game.
Diffstat (limited to 'crawl-ref/source/package.h')
-rw-r--r-- | crawl-ref/source/package.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/package.h b/crawl-ref/source/package.h index 10b21ad0bc..a6e471dffd 100644 --- a/crawl-ref/source/package.h +++ b/crawl-ref/source/package.h @@ -92,12 +92,14 @@ private: std::map<len_t, len_t> free_blocks; std::stack<len_t> unlinked_blocks; std::map<len_t, std::pair<len_t, len_t> > block_map; + std::set<len_t> new_chunks; len_t extend_block(len_t at, len_t size, len_t by); len_t alloc_block(len_t &size); void finish_chunk(const std::string name, len_t at); void free_chunk(const std::string name); len_t write_directory(); void collect_blocks(); + void free_block_chain(len_t at); void free_block(len_t at, len_t size); void seek(len_t to); void fsck(); |