1 %---------------------------------------------------------------*
3 \section{Wrappers around malloc}
5 %---------------------------------------------------------------*
7 Routines that deal with memory allocation:
9 A LONG-AGO WISH: All dynamic allocation must be done before the stacks
10 and heap are allocated. This allows us to use the lower level sbrk
13 ANOTHER ONE: Should allow use of valloc to align on page boundary.
19 stgMallocBytes(n, msg)
25 if ((space = (char *) malloc((size_t) n)) == NULL) {
27 MallocFailHook((W_) n, msg); /*msg*/
34 stgMallocWords(n, msg)
38 return(stgMallocBytes(n * sizeof(W_), msg));