To store data in an insertion process, a process 1 that inserts data into
a new block and a process 2 that inserts, within the block reserved, data
into areas that became free when data was deleted are prepared. A
switching event to switch from the process 1 to the process 2 is
designated in advance. The occurrence of the designated event is checked
while executing the process 1 in an insertion process, and if the
designated event occurs, the insertion process executes the process 2. If
during the execution of the process 2, areas that can be reused become
depleted, the execution of the insertion process reverts back to the
process 1. As a result, free areas resulting from deletions can be reused
according to the switching event designated.