vmalloc() and vfree() allocate and free memory from $$$$vmem.tmp. The analogous functions in C are malloc() and free(). vmalloc() returns a void hdr, which can be cast. vfree() frees the memory, but returns a 1 on error and sets an error message number. This differs from free() which returns no value.
The algorithms of these functions are difficult to explain, so the reader is referred to Holub[#!Ho:pr!#] and Kernighan and Ritchie[#!kr:cprg!#]. Tondo and Gimpel[#!tg:answ!#] also offer some insight into the problem. The basic idea behind vmalloc() is to search the free list for a set of blocks large enough to fulfill the request. If one is not found, the $$$$vmem.tmp grows. The basic idea behind vfree() is to delete the vmem structure and place the hdr in the freelist. Space around the freed blocks is coalesced. This helps reduce checker-boarding of the memory. Data is stored in contiguous blocks.