Mail Archives: djgpp/1997/07/02/07:50:14
Mike Winsor writes:
>Well, I've fixed something with this. Now when it loads the maps files it
>eats only 8k once... not 8 every time it loads, just once. BUT I'm still
>having a nasty problem with the animations being loaded... It seems to EAT
>84k each time it plays... PLEASE I need help with this... Shawn, if you can
>help please do.....
How do you know it's leaking memory? If you are calling the DPMI
functions to query the amount of free memory, the return value is pretty
meaningless because a) physical memory is often only actually allocated
when you use it, so it's possible to call malloc() and not see any
change in the amount of free space, and b) the libc implementation of
free() doesn't return memory to the DPMI server, but stores it in an
internal heap for reuse by subsequent malloc() calls. So the DPMI memory
information calls are not all that useful :-)
If you really are leaking RAM, you have my sympathy, but I'm afraid
there isn't anything I can do about it! Memory allocation bugs can be an
absolute nightmare to locate - you're just going to have to go through
all your code making sure you release everything that you allocate
(including things like destroying any BITMAP objects you create, closing
files, etc). It might be worth trying a debug version of the malloc
library: I've never used one of these myself, but some people swear by
them...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -