next up previous contents index
Next: Window Overlapping and Fragmentation Up: Arena Class Previous: Allocation

Mapping

There are several primitive operations for the mapping. The Figure 3.8 shows the fundamentals of the mapping operations.

The map()
private operation is internally used for the mapping and address conversion. The operation searches for the appropriate Window for the object at the specified offset. If the search succeeds, it converts the offset to the pointer to the Chunk. If the search fails, it creates a new Window object for mapping and then converts the offset. This operation is mainly implemented in the private operation mapWindow(). The private operation map() invokes the mapWindow() and the address conversion operation Window::map() to convert the offset to the pointer.
The grab()
protected operation maps the object at the specified offset and sets the grabbed flag of the object. The Window is not unmapped during the object is grabbed.

The release()
protected operation clears the grabbed flag of the object. The Window containing the object may be unmapped sooner or later.

The grabReadOnly()
protected operation maps the object at the specified offset and increments the counter for the read-only grabbings of the object. The Window is not unmapped during the object is grabbed.

The releaseReadOnly()
protected operation decrements the counter for the read-only grabbings of the object. The Window containing the object may be unmapped if the counter is 0 and the grabbed flag is clear.

The synchronize()
protected operation synchronizes the Window containing the specified offset with the storage file. If the offset is not specified, the operation synchronizes all the Windows in the Arena.

The cleanUp()
protected operation unmaps all or some of the removable Windows in the Arena. It also synchronizes the Windows before unmapping. This operation is invoked by the PersistentStorage at the appropriate timings.

The grow()
operation stretches the storage file of the Arena by appending a new free block. The sizes of the topChunk and of the arenaSize grow up. This operation is invoked by the PersistentStorage when the topChunk is too small.

next up previous contents index
Next: Window Overlapping and Fragmentation Up: Arena Class Previous: Allocation
Mori Tetsuya / t2y3141592@gmail.com