Next: objects codes ops, Up: objects codes [Index]
A code object is a memory block, of variable size, referenced by machine
words tagged as vectors; the memory is allocated with mmap()
and
is given read, write and execution protection. The layout of a code
object is as follows:
|-----------|-----------------------------------| code object meta data data area
the data area is filled with executable machine code.
The first machine word of a code memory block is tagged has code in its least significant bits and it has the most significant bits set to zero.
|------------------------|-------------| reference to code memory pointer vector tag |------------------------|-------------| code first word all set to zero code tag
Scheme code objects which are part of the boot image are of 2 categories:
current code page |..........................................................| code object code object code object free |.............|.............|.............|++++++++++++++++| |----------------------------------------------------------|
the free room at the end of the sequence of code objects is lost.
page page page page page |...........|...........|...........|...........|...........| large code object free |---------------------------------------------------|+++++++|
the free room at the end of the sequence of pages is lost. Large code objects are never moved by the garbage collector.
The first words of a code memory block hold meta data:
#f
.
the subsequent words in the memory block are the code object’s data area.
Next: objects codes ops, Up: objects codes [Index]