diff -r fa9941cf3867 -r 667e88a979d7 persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp --- a/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp Fri Mar 12 15:51:02 2010 +0200 +++ b/persistentstorage/sql/SRC/Client/SqlDatabaseImpl.cpp Mon Mar 15 12:46:30 2010 +0200 @@ -1,4 +1,4 @@ -// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -39,7 +39,7 @@ static const TInt KCompactStartStepSize = 32 * 1024; /** -Calculates the amount of space that has to be removed from the database. +The aim of the function is to determine the maximum size of space to be freed, which fits within the time constraint. The decision is based on the time spent on the pervious compaction step. If the time is bigger than KCompactMaxStepTimeUs then the space will be reduced by factor of 2 (slow media), bet will never be less than KCompactMinStepSize. @@ -72,7 +72,8 @@ aStep *= 2; } if(aRemaining < aStep) - { + {//If, for example, aStep is 4000 bytes, aRemaining is 2000 bytes, then the step should be 2000, + //because that is what is left in the database as a free space. aStep = aRemaining; } return aStep;