Subject: memory leaks (This message is being sent to CPSC 215 Students and TA's) I have noticed that many sp6 programs are leaking memory in a big way. Since only 4 rays are fired in sp6, there is no ill effect of the leak and since we haven't discussed this much in class, I will not penalize it on sp6. These leaks MUST be corrected in the ray tracer. The basic rules that should be followed are: (1) things malloc'ed in projection_init/model_init need to exist until the program ends and should NOT BE FREED (2) for every other instance of malloc() there MUST be a corresponding free() IN THE FUNCTION in which the malloc() occurs. (3) a better option is to change all malloc() EXCEPT THOSE in projection_init/model_init to alloca() The alloca() function allocates small amounts of storage on the stack and it does not require the use of free() to release the storage. In fact attempting to free() storage allocated with alloca() is a FATAL ERROR. More on this in class monday.