Symbian3/PDK/Source/GUID-34E19A27-F61D-5190-8709-151523CB0BE1.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept xml:lang="en" id="GUID-34E19A27-F61D-5190-8709-151523CB0BE1"><title>Reclamation and compaction, incrementally</title><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> <section><title>See also</title> <p><xref href="GUID-6EE0CB66-A759-5E0C-884D-90895F35F267.dita">Transactions</xref> </p> <p><xref href="GUID-C2608BF5-CDA7-530A-B67A-0414C7FA585D.dita">High level asynchronous service handling</xref> </p> </section> </conbody></concept>
    12 <concept id="GUID-34E19A27-F61D-5190-8709-151523CB0BE1" xml:lang="en"><title>Reclamation
       
    13 And Compaction, Incrementally</title><shortdesc>Explains how to reclaim and compact incrementally by using smaller
       
    14 steps.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <p>Both space reclamation and compaction can be done incrementally, i.e. broken
       
    16 down into smaller steps. This allows an application to alternate reclamation
       
    17 and compaction with other processing and remain responsive to other events.</p>
       
    18 <p>To do this, construct an object of type <codeph>RStoreReclaim</codeph> and
       
    19 call:</p>
       
    20 <ul>
       
    21 <li id="GUID-4C8737BC-BCEA-5D06-9F31-5E823EE39C46"><p><codeph>RStoreReclaim::OpenL()</codeph> or <codeph>RStoreReclaim::OpenLC()</codeph> to
       
    22 prepare the <codeph>RStoreReclaim</codeph> object to perform space reclamation.</p> </li>
       
    23 <li id="GUID-49C343FC-1C3F-5D92-A846-FC65EBEBDFA8"><p><codeph>RStoreReclaim::CompactL()</codeph> or <codeph>RStoreReclaim::CompactLC()</codeph> to
       
    24 prepare the <codeph>RStoreReclaim</codeph> object to perform compaction.</p> </li>
       
    25 </ul>
       
    26 <p>Each stage of space reclamation and compaction is performed or initiated
       
    27 by calling the appropriate variant of <codeph>RStoreReclaim::Next()</codeph> or <codeph>RStoreReclaim::NextL()</codeph>.
       
    28 The class provides both synchronous and asynchronous variants of these two
       
    29 functions. The asynchronous versions initiate the next stage of space reclamation
       
    30 and compaction.</p>
       
    31 <p>At any time during space reclamation or compaction, the <codeph>RStoreReclaim::Available()</codeph> returns
       
    32 a running total of free space discovered so far.</p>
       
    33 <p>Compaction and normal access to the store interact in the following ways:</p>
       
    34 <ul>
       
    35 <li id="GUID-CE0ADA7E-0790-55A6-B9E3-4A237DACEE1E"><p>if a compaction step
       
    36 is in progress, committing the store causes the compaction step to be abandoned
       
    37 and to complete or leave with <codeph>KErrNotReady</codeph>. All subsequent
       
    38 attempts to initiate a compaction step, complete or leave with <codeph>KErrNotReady</codeph>.
       
    39 Compaction can be restarted by first doing a reset, i.e. by calling <codeph>ResetL()</codeph>.</p> </li>
       
    40 <li id="GUID-86F776A3-D1C0-55DB-A365-C085BFEFA28F"><p>a compaction step which
       
    41 needs to physically move a stream, completes or leaves with <codeph>KErrInUse</codeph>,
       
    42 if any stream within the store is open. The stream must be closed before initiating
       
    43 another compaction step.</p> </li>
       
    44 </ul>
       
    45 <p>Once compaction is complete, the store must be committed.</p>
       
    46 <p>Doing an incremental space reclamation or compaction asynchronously requires
       
    47 the use of active objects. </p>
       
    48 </conbody></concept>