In miscres.c, routine ifsload(), line 1438 is this code: if ((ifs_defn = (float far *)farmemalloc( (long)((NUMIFS+1)*IFS3DPARM*sizeof(float)))) == NULL) { which allocates some memory into ifs_defn. Earlier in this same function, the same pointer is checked to see if it is non-NULL and if so, it is freed before being allocated later in the function. However, once allocated, this memory will always be allocated because it will only be freed right before we're ready to allocate memory for it again. So, you get a memory leak. What's the right place to release the memory? -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Rich,
In miscres.c, routine ifsload(), line 1438 is this code:
if ((ifs_defn = (float far *)farmemalloc( (long)((NUMIFS+1)*IFS3DPARM*sizeof(float)))) == NULL) {
which allocates some memory into ifs_defn. Earlier in this same function, the same pointer is checked to see if it is non-NULL and if so, it is freed before being allocated later in the function.
However, once allocated, this memory will always be allocated because it will only be freed right before we're ready to allocate memory for it again.
So, you get a memory leak.
What's the right place to release the memory?
I've been putting them in goodbye() in prompts2.c. We should look at deallocating this memory when we change fractal types, as well. Jonathan
In article <1169691310.13526.19.camel@linux.site>, Jonathan Osuch <osuchj@avalon.net> writes:
What's the right place to release the memory?
I've been putting them in goodbye() in prompts2.c.
OK, I can do that.
We should look at deallocating this memory when we change fractal types, as well.
Is there a single place where this is done? -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Rich,
We should look at deallocating this memory when we change fractal types, as well.
Is there a single place where this is done?
In framain2.c at the two case 't' sections, might be easiest. The alternative would be after imagestart: in fractint.c. Are there any obvious conditions which would require the amount of memory allocated to be changed? Jonathan
In article <1169693251.13690.5.camel@linux.site>, Jonathan Osuch <osuchj@avalon.net> writes:
Are there any obvious conditions which would require the amount of memory allocated to be changed?
I didn't look into it too closely; it just burped out as a memory leak reported by the VC runtime in debug mode. I added code to prompts2.c to take care of the leak. I'm not worried about it hanging around until you exit because we aren't under the tight memory constraints of the 16-bit world. -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
participants (2)
-
Jonathan Osuch -
Richard