]> git.ipfire.org Git - thirdparty/squid.git/commit - src/store.cc
trimMemory for unswappable objects
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 13 Jan 2012 13:49:26 +0000 (15:49 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 13 Jan 2012 13:49:26 +0000 (15:49 +0200)
commit5b55f1f1555190af35a2e814ab2ff010a5846f3f
tree4235a66b25e3630e9de641d4523c23f879c2bef9
parent88472ef6d2e0cb416e79cc718268384605962dbf
trimMemory for unswappable objects

Inside StoreEntry::swapOut() the StoreEntry::trimMemory() method called to
release unused MemObjects memory. The trimMemory method must called for all
store entries, but current code blocks that call for not-swappable objects,
at least.

This patch trying to fix this bug implementing the following simple logic:
   {
     bool weAreOrMayBeSwappingOut =
           swappingOut() || mayStartSwapout();

     trimMemory(weAreOrMayBeSwappingOut);

     if (!weAreOrMayBeSwappingOut)
         return; // nothing else to do
   }

This is a Measurement Factory project
src/MemObject.cc
src/MemObject.h
src/Store.h
src/store.cc
src/store_client.cc
src/store_swapout.cc
src/tests/stub_MemObject.cc
src/tests/stub_store.cc