This layer is the lowest to implement structured data nodes. Fig. 6.4 shows the general structure of such a basic layer node. The header word of the node determines its type and structure, i.e. the type and number of the generic and specific data slots. The former are common to each node type whereas the latter carry the actual data visible to upper layers. Thus the shaded fields in this figure are maintained and used by the basic layer. For the unshaded fields the basic layer just reserves space and provides access functions.
Figure 6.4: Implementation of a basic layer node
The possible data types of the specific slots as determined by the tag field of the header word are:
It should be noted that in contrast to LISP storage concepts, all nodes of the basic layer (and hence the PIF Application Interface) are originally kept on a file and are just cached through the caching layer. This implies, that all reference pointers stored in a basic layer node are file offset pointers and thus do not point to memory locations. It is the caching layer's duty to resolve those references correctly.
To illustrate the different storage concepts, let us consider the simple PIF expression (ref P (valueList 1 2)).
Figure 6.5: Example of a LISP internal data structure
Figure 6.6: Example of a PIF binary file and basic
layer data structure
This construct represents a reference to the first two points of a pointList P. Fig. 6.5 shows how this construct would be stored in the XLISP interpreter with separate CONS nodes. The corresponding PBF structure, as it is handled in the basic layer, is shown in Fig. 6.6. The CONS nodes are fused with the CAR data values, to compact the data structures and minimize data access time, which is crucial on slower external storage media. Furthermore, this concept retains the principle extension language storage structures on the data level.
Figure 6.7: Layout of a PIF physical file with multiple
logical files
Using this concept of LISP-like information nodes the PLB is stored, whereas the PBF is built as a linked list of PLBs, shown in Fig. 6.7. Since this list is only searched when the file is opened, this is no performance drawback. The data area is shared by all PLBs in the PBF, but on write operations it is checked that no crosspointers into disjoint PLBs occur. To allow fast access to all symbols, these are stored in a hash table which is unique for each PLB so that there are no conflicts between different PLBs.