Magic Numbers¶
Many of the SSlib data structures have an unsigned
int
member that will contain a magic number
while the struct is allocated. The magic number serves to run-time type the struct. The most significant 12
bits are 0x5af (looks sort of like “Saf”). The next eight bits are a type class number (e.g., all storable
object handles belong to a certain class). The least significant 12 bits are a unique sequence number for that
particular type class and are sometimes used as indices into various arrays.