Symbian3/SDK/Source/GUID-34E19A27-F61D-5190-8709-151523CB0BE1.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-34E19A27-F61D-5190-8709-151523CB0BE1" xml:lang="en"><title>Reclamation
And Compaction, Incrementally</title><shortdesc>Explains how to reclaim and compact incrementally by using smaller
steps.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Both space reclamation and compaction can be done incrementally, i.e. broken
down into smaller steps. This allows an application to alternate reclamation
and compaction with other processing and remain responsive to other events.</p>
<p>To do this, construct an object of type <codeph>RStoreReclaim</codeph> and
call:</p>
<ul>
<li id="GUID-4C8737BC-BCEA-5D06-9F31-5E823EE39C46"><p><codeph>RStoreReclaim::OpenL()</codeph> or <codeph>RStoreReclaim::OpenLC()</codeph> to
prepare the <codeph>RStoreReclaim</codeph> object to perform space reclamation.</p> </li>
<li id="GUID-49C343FC-1C3F-5D92-A846-FC65EBEBDFA8"><p><codeph>RStoreReclaim::CompactL()</codeph> or <codeph>RStoreReclaim::CompactLC()</codeph> to
prepare the <codeph>RStoreReclaim</codeph> object to perform compaction.</p> </li>
</ul>
<p>Each stage of space reclamation and compaction is performed or initiated
by calling the appropriate variant of <codeph>RStoreReclaim::Next()</codeph> or <codeph>RStoreReclaim::NextL()</codeph>.
The class provides both synchronous and asynchronous variants of these two
functions. The asynchronous versions initiate the next stage of space reclamation
and compaction.</p>
<p>At any time during space reclamation or compaction, the <codeph>RStoreReclaim::Available()</codeph> returns
a running total of free space discovered so far.</p>
<p>Compaction and normal access to the store interact in the following ways:</p>
<ul>
<li id="GUID-CE0ADA7E-0790-55A6-B9E3-4A237DACEE1E"><p>if a compaction step
is in progress, committing the store causes the compaction step to be abandoned
and to complete or leave with <codeph>KErrNotReady</codeph>. All subsequent
attempts to initiate a compaction step, complete or leave with <codeph>KErrNotReady</codeph>.
Compaction can be restarted by first doing a reset, i.e. by calling <codeph>ResetL()</codeph>.</p> </li>
<li id="GUID-86F776A3-D1C0-55DB-A365-C085BFEFA28F"><p>a compaction step which
needs to physically move a stream, completes or leaves with <codeph>KErrInUse</codeph>,
if any stream within the store is open. The stream must be closed before initiating
another compaction step.</p> </li>
</ul>
<p>Once compaction is complete, the store must be committed.</p>
<p>Doing an incremental space reclamation or compaction asynchronously requires
the use of active objects. </p>
</conbody></concept>