Portable electronic device with garbage collection function
First Claim
1. A portable electronic device comprising:
- memory means divided into a plurality of areas, each area storing input data and attribute data of the input data, the attribute data comprising a first flat indicating whether input data has previously been written in the area, and a second flag indicating whether the input data previously stored in the area is deletable;
means for writing input data in the area whose first flag indicates that input data has not been previously written therein;
means for deleting input data in the area whose second flag indicates that input data previously stored therein is deletable;
first changing means for changing the first flag to indicate that input data has been written in the corresponding area or to indicate that input data has not been written in the corresponding area;
second changing means for changing the second flag to indicate that the previously stored input data is deletable in the corresponding area or to indicate that the previously stored input data is not deletable in the corresponding area; and
data rearrangement means for copying previously stored input data into another area and deleting the previously stored input data from the area where previously stored in accordance with the corresponding first and second flags for each area, and for causing the first and second flags for each area to be changed by said first and second data changing means to indicate the data rearrangement.
1 Assignment
0 Petitions
Accused Products
Abstract
A portable electronic device of this invention has a control CPU (Central Processing Unit) and a data memory. The data memory is divided into a plurality of areas, and each area consists of a data area and an attribute area indicating an attribute of the data area. The attribute area consists of a first flag indicating whether or not data is stored in the data area, a second flag indicating whether or not data written in the data area is valid, and a third flag indicating whether or not data written in the data area is stored as a block. When an instruction supplied from a host system is a valid-data rearrangement instruction, the control CPU refers to the second flag, and sets a first flag of a data area whose second flag indicates that data is invalid to indicate that data is unwritten, thus rear-ranging valid data of the data memory so that no invalid data area is present between valid data areas. When the third flag indicates write incompletion, the control CPU sets the second flag to make the data area invalid.
-
Citations
5 Claims
-
1. A portable electronic device comprising:
-
memory means divided into a plurality of areas, each area storing input data and attribute data of the input data, the attribute data comprising a first flat indicating whether input data has previously been written in the area, and a second flag indicating whether the input data previously stored in the area is deletable; means for writing input data in the area whose first flag indicates that input data has not been previously written therein; means for deleting input data in the area whose second flag indicates that input data previously stored therein is deletable; first changing means for changing the first flag to indicate that input data has been written in the corresponding area or to indicate that input data has not been written in the corresponding area; second changing means for changing the second flag to indicate that the previously stored input data is deletable in the corresponding area or to indicate that the previously stored input data is not deletable in the corresponding area; and data rearrangement means for copying previously stored input data into another area and deleting the previously stored input data from the area where previously stored in accordance with the corresponding first and second flags for each area, and for causing the first and second flags for each area to be changed by said first and second data changing means to indicate the data rearrangement. - View Dependent Claims (2, 3, 4)
-
-
5. A data rearrangement method for a portable electronic device having memory means, comprising:
-
(a) dividing said memory means into a plurality of areas, each area storing input data and attribute data of the input data, the attribute data comprising a first flag indicating whether input data has previously been written in the area, and a second flag indicating whether the input data previously stored in the area is deletable; (b) writing input data in the area whose first flag indicates that input data has not been previously written therein, and thereafter, for rewriting the first flag to indicate that input data has been written in the area; (c) rewriting the second flag to indicate that previously stored input data is deletable when both the previously stored input data is deletable and the corresponding first flag indicates that input data has been written in the area; (d) sequentially reading the second flag of the attribute data, area by area, for deleting previously stored input data of the area whose second flag indicates that the previously stored input data is deletable, for rewriting the first flag to indicate that input data has not been written in the area, and for storing the address of the location of the area in a predetermined area of said memory means; (e) sequentially reading the attribute data of the areas located in addresses subsequent to the address stored in the predetermined area of said memory means, for detecting the area whose first flag indicates that input data has previously been written in the area and whose second flag indicates that the previously written input data is not deletable, rewriting the second flag to indicate that the previously written input data is deletable, and for writing the input data previously written into the area into another area designated by the address stored in the predetermined area of said memory means; and (f) repeating steps (d) and (e) until deletable areas are not present between the areas which store written input data which is not deletable.
-
Specification