next up previous contents
Next: Linked Lists Up: PFS Library Previous: Initialization

Data Structures

Most of the data structures in the PFS library are allocated and freed with special allocation functions ( VLINKs are allocated with vlalloc and freed with vlfree or vllfree, etc.) The allocation functions also initialize the members of the structure to common values and the freeing functions de-allocate allocated memory referred to by the members of the structure.

Do not use the C library function free to free memory allocated by one of the special Prospero allocating functions, and do not use one of the special freeing functions to free memory allocated by malloc.

The VDIR structure does not have special allocation and freeing structures. This is because in the current uses of the Prospero library, one generally does not make linked lists of VDIR structures; instead, one allocates them on the stack with code that looks like this:

VDIR_ST dir_st;
VDIR dir = &dir_st;
and then initializes them with:
vdir_init(dir);
and frees the allocated memory referred to by the members with:
vdir_freelinks(dir);





Padma Indraganti
Wed Jun 19 18:04:04 PDT 1996