When using the NewList() function described in exec/lists.h (at least in SAS/C 6.58), does one need to allocate memory for a new list separately? What does NewList() do exactly?
/* Is NewList(struct List *) the same as the following? */
struct List *list;
list = (struct List *)AllocMem(sizeof(struct List), MEMF_ANY);
memset(list, 0L, sizeof(struct List));
/* Or does it do some magic black box stuff? And if I want to pass
my list around, should I malloc() the memory for the list and then
remember to free it myself later; after passing it around */
list = (struct List *)malloc(sizeof(struct List));
NewList(list);
// ... use the list
free(list);