Index - All Packages - All Categories - All Classes

Class SnarfInfoHandler

The SnarfInfoHandler is an interface to the first few snarfs in an urdi that tells how much space is unallocated in each of the remaining snarfs, and keeps a bit as to whether any forgotten objects are in each snarf.

The data is kept packed in the first few snarfs with 4 bytes per snarf recorded. The forgotten bit is the high bit of each entry.

mySnarfs is a table of SnarfHandles onto the snarfInfo snarfs (the first few snarfs in the Urdi). You release those snarfs by destroying the snarfInfoHandler and creating a new one when you want the information again.

myTotal is the total number of snarfs in the Urdi.

Package: Udanax-Gold
All Superclasses: Object Heaper
Protocols: Object
Categories: Xanadu-Urdi

Class Methods

createUrdi: urdi with: view


createUrdiView: view with: urdi


initializeSnarfInfo: urdi with: view


linkTimeNonInherited

self hack.

make: urdi with: view



Instance Methods

actualHashForEqual


createUrdi: urdi with: view

This constructor is for a newly created urdi with no existing snarfInfo
information. Set the spaceLeft for each snarf to its maximum and clear the
forgotten flag. Note that this figures out how many snarfInfo snarfs to use on
the fly by allocating as many snarfInfo cells as it can in the first snarf, then
going on to the second snarf, until enough snarfInfo snarfs are allocated. Then
it goes through all the entries in the snarfInfo for each non-snarfInfo snarf
and set the spaceLeft appropriately.

createUrdiView: view with: urdi

This constructor is for reopening an existing urdi and using its existing snarfInfo.
Read snarfs until it has enough cells for all snarfs in fthe urdi.

destruct

Release all my handles before going away.

Overrides: Heaper

getForgottenFlag: snarfID

Return the forgotten bit for the snarf at snarfID.

getSpaceLeft: snarfID

Return the spaceLeft for the snarf at snarfID.

initializeSpaceLeft: snarfID with: space

Se the spaceLeft to a certain amount, and clear all the flags. This is used
when initializing the snarfInfo so we don't get confused by the flags.

locate: snarfID

Return the snarfHandle for the snarfInfo snarf that contains the spaceLeft and forgotten flag for the snarf at snarfID.

setForgottenFlag: snarfID with: flag

Set or clear the forgotten bit for the snarf at snarfID.

setSpaceLeft: snarfID with: space

Set the space for the snarf at snarfID.

snarfCount

Return the total number of snarfs in the urdi.

snarfInfoCount

Return the number of snarfs that the snarf info information takes
up. This is used to know what snarf to get the first object from.


Index - All Packages - All Categories - All Classes