From 7ea5c06059ee6668d6e6d04c3b3dcb8557061696 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 15 Jun 2012 13:27:59 +0000 Subject: 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 :) --- src/stable/myriad.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/stable/myriad.h') 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 @@ #include "bu/array.h" #include "bu/hash.h" #include "bu/mutex.h" +#include "bu/extratypes.h" namespace Bu { @@ -139,9 +140,9 @@ namespace Bu int getBlockSize(); int getNumBlocks(); int getNumUsedBlocks(); - int getTotalUsedBytes(); - int getTotalUnusedBytes(); - int getTotalUnusedBytes( int iFakeBlockSize ); + Bu::size getTotalUsedBytes(); + Bu::size getTotalUnusedBytes(); + Bu::size getTotalUnusedBytes( int iFakeBlockSize ); /** * Syncronize the header data, etc. with the storage stream. It's not @@ -163,7 +164,7 @@ namespace Bu */ static bool isMyriad( Bu::Stream &sStore ); - const Bu::BitString &getBlocksUsed() const; + const Bu::BitString getBlocksUsed() const; private: /** @@ -219,7 +220,9 @@ namespace Bu int iBlockSize; int iBlocks; int iUsed; - Bu::BitString bsBlockUsed; + typedef Bu::List IndexList; + IndexList lFreeBlocks; +// Bu::BitString bsBlockUsed; StreamArray aStreams; typedef Bu::Hash BlockHash; BlockHash hActiveBlocks; -- cgit v1.2.3