Skip to content

Commit

Permalink
Small progress
Browse files Browse the repository at this point in the history
  • Loading branch information
bergloman committed Oct 20, 2014
1 parent 5e6cc57 commit ae6b480
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/glib/base/gix.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class TGixStorageLayer {
int GetCacheSize() const { return ItemSetCache.GetMemUsed(); }
bool IsCacheFull() const { return CacheFullP; }
void RefreshMemUsed();
void AddToNewCacheSizeInc(int64 diff){ NewCacheSizeInc += diff; }

/// for storing item sets from cache to blob
TBlobPt StoreItemSet(const TBlobPt& KeyId);
Expand Down Expand Up @@ -675,13 +676,8 @@ void TGix<TKey, TItem>::AddItem(const TKey& Key, const TItem& Item) {
TBlobPt KeyId = AddKeyId(Key);
// load the current item set
PGixItemSet ItemSet = GetItemSet(Key);

// TODO tole je tricky - itemset se spremeni in bi moral o tem obvestiti cache
// ki bi moral narediti reload

// add the new item to the set and update the size of new items
//NewCacheSizeInc += int64(ItemSet->AddItem(Item));
ItemSet->AddItem(Item);
GixSL->AddToNewCacheSizeInc(ItemSet->AddItem(Item));
// check if we have to drop anything from the cache
RefreshMemUsed();
}
Expand All @@ -692,14 +688,9 @@ void TGix<TKey, TItem>::AddItemV(const TKey& Key, const TVec<TItem>& ItemV) {
// get the key handle
TBlobPt KeyId = AddKeyId(Key);
// load the current item set
PGixItemSet ItemSet = GetItemSet(Key);

// TODO tole je tricky - itemset se spremeni in bi moral o tem obvestiti cache
// ki bi moral narediti reload

PGixItemSet ItemSet = GetItemSet(Key);
// add the new items to the set and update the size of new items
//NewCacheSizeInc += int64(ItemSet->AddItemV(ItemV));
ItemSet->AddItemV(ItemV);
GixSL->AddToNewCacheSizeInc(ItemSet->AddItemV(ItemV));
// check if we have to drop anything from the cache
GixSL->RefreshMemUsed();
}
Expand Down

0 comments on commit ae6b480

Please sign in to comment.