Follow

Man, it took me a whole hour to mentally do basic (pointer) arithmetic...

I couldn't for the life of me figure out the free space condition. A page later there is the definition of a function that gives you the length of a str variable then it hit me:

Storage allocation uses a Stack. allocp points to the first element of allocbuf, which is last object inserted. In effect, free space is ALLOCSIZE - (allocp - allocbuff) HENCE the fit condition.
To free pointer p, the condition is to be in allocp

Sign in to participate in the conversation
Merovingian Club

A club for red-pilled exiles.