14.5 xfree (4398)

“xfree” is called by “exit” (3233); when a process is being terminated, and by “exec” (3128), when a process is being transmogrified.

4402:

Set the text pointer in the “proc” entry to “NULL”;

4403:

Decrement the main memory count and if it is now zero ...

4406:

and if the text segment has not been flagged to be saved, ...

4408:

Abandon the image of the text segment in the disk swap area;

4411:

Call “iput” (7344) to decrement the “inode” reference count and if necessary delete it.

“ISVTX” (5695) is a mask which defines the “sticky bit” mentioned in section “CHMOD(I)” of the UPM. If this bit is set, the disk copy of the text segment is allowed to remain in the disk swap area even when no programs are running which reference it, in the expectation that it will be required again shortly. This is an efficient device for commonly used programs such as the “shell” or the editor.