From 5fdf49f609a658161f482b406590531d4941ac46 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 5 Apr 2011 00:44:48 +0000 Subject: Fixed the cache system missing a sync on header data for inserts and deletes. --- src/cache.h | 6 ++++-- src/cachestoremyriad.h | 1 - src/myriad.cpp | 5 +++++ src/myriad.h | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/cache.h b/src/cache.h index a2774ce..455cf1b 100644 --- a/src/cache.h +++ b/src/cache.h @@ -16,8 +16,6 @@ #include "bu/trace.h" -#include "bu/sio.h" - namespace Bu { // template @@ -242,6 +240,8 @@ namespace Bu pCalc->onLoad( pData, k ); + pStore->sync(); + return Ptr( this, pData, k ); } @@ -331,6 +331,7 @@ namespace Bu hEnt.erase( cId ); pStore->destroy( pObj, cId ); + pStore->sync(); } catch( Bu::HashException &e ) { pCalc->onDestroy( cId ); @@ -343,6 +344,7 @@ namespace Bu else { pStore->destroy( cId ); + pStore->sync(); } } } diff --git a/src/cachestoremyriad.h b/src/cachestoremyriad.h index e36506e..e632a82 100644 --- a/src/cachestoremyriad.h +++ b/src/cachestoremyriad.h @@ -98,7 +98,6 @@ namespace Bu MyriadStream ns = mStore.openStream( iStream ); __cacheStoreMyriadStore( ns, *pSrc, key ); ns.setSize( ns.tell() ); - sync(); return key; } diff --git a/src/myriad.cpp b/src/myriad.cpp index 0e8dc80..b582df3 100644 --- a/src/myriad.cpp +++ b/src/myriad.cpp @@ -656,3 +656,8 @@ bool Bu::Myriad::isMyriad( Bu::Stream &sStore ) return true; } +const Bu::BitString &Bu::Myriad::getBlocksUsed() const +{ + return bsBlockUsed; +} + diff --git a/src/myriad.h b/src/myriad.h index 86c7aa1..3382ab5 100644 --- a/src/myriad.h +++ b/src/myriad.h @@ -155,6 +155,8 @@ namespace Bu */ static bool isMyriad( Bu::Stream &sStore ); + const Bu::BitString &getBlocksUsed() const; + private: /** * Initialize this object based on the data already in the assosiated -- cgit v1.2.3