diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-06-15 13:27:59 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-06-15 13:27:59 +0000 |
commit | 7ea5c06059ee6668d6e6d04c3b3dcb8557061696 (patch) | |
tree | 9ae2f93d09346c0272240015443e1a2bc660dd68 /src/stable/myriad.h | |
parent | 026cd6f71a15edd1a242c59d5cb9f8271a108506 (diff) | |
download | libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.tar.gz libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.tar.bz2 libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.tar.xz libbu++-7ea5c06059ee6668d6e6d04c3b3dcb8557061696.zip |
Bu::Myriad now only uses BitString during initialization, and I'm going to
replace that with just an array, no problem. It's many, many, many times
faster while streams are growing, and it should be constant time, not linear
like it was before.
It also handles myriad files in excess of 2gb correctly now, at least, it
seems to just fine :)
Diffstat (limited to 'src/stable/myriad.h')
-rw-r--r-- | src/stable/myriad.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/stable/myriad.h b/src/stable/myriad.h index 80b5c2b..6b1db41 100644 --- a/src/stable/myriad.h +++ b/src/stable/myriad.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include "bu/array.h" | 14 | #include "bu/array.h" |
15 | #include "bu/hash.h" | 15 | #include "bu/hash.h" |
16 | #include "bu/mutex.h" | 16 | #include "bu/mutex.h" |
17 | #include "bu/extratypes.h" | ||
17 | 18 | ||
18 | namespace Bu | 19 | namespace Bu |
19 | { | 20 | { |
@@ -139,9 +140,9 @@ namespace Bu | |||
139 | int getBlockSize(); | 140 | int getBlockSize(); |
140 | int getNumBlocks(); | 141 | int getNumBlocks(); |
141 | int getNumUsedBlocks(); | 142 | int getNumUsedBlocks(); |
142 | int getTotalUsedBytes(); | 143 | Bu::size getTotalUsedBytes(); |
143 | int getTotalUnusedBytes(); | 144 | Bu::size getTotalUnusedBytes(); |
144 | int getTotalUnusedBytes( int iFakeBlockSize ); | 145 | Bu::size getTotalUnusedBytes( int iFakeBlockSize ); |
145 | 146 | ||
146 | /** | 147 | /** |
147 | * Syncronize the header data, etc. with the storage stream. It's not | 148 | * Syncronize the header data, etc. with the storage stream. It's not |
@@ -163,7 +164,7 @@ namespace Bu | |||
163 | */ | 164 | */ |
164 | static bool isMyriad( Bu::Stream &sStore ); | 165 | static bool isMyriad( Bu::Stream &sStore ); |
165 | 166 | ||
166 | const Bu::BitString &getBlocksUsed() const; | 167 | const Bu::BitString getBlocksUsed() const; |
167 | 168 | ||
168 | private: | 169 | private: |
169 | /** | 170 | /** |
@@ -219,7 +220,9 @@ namespace Bu | |||
219 | int iBlockSize; | 220 | int iBlockSize; |
220 | int iBlocks; | 221 | int iBlocks; |
221 | int iUsed; | 222 | int iUsed; |
222 | Bu::BitString bsBlockUsed; | 223 | typedef Bu::List<int> IndexList; |
224 | IndexList lFreeBlocks; | ||
225 | // Bu::BitString bsBlockUsed; | ||
223 | StreamArray aStreams; | 226 | StreamArray aStreams; |
224 | typedef Bu::Hash<int, Block *> BlockHash; | 227 | typedef Bu::Hash<int, Block *> BlockHash; |
225 | BlockHash hActiveBlocks; | 228 | BlockHash hActiveBlocks; |