www.delorie.com/djgpp/bugs/show.cgi | search |
There seems to be no way to unload a DXE file. Free(DXEPTR) would by definition (?) only work if DXEPTR points to the beginning of the memory area occupied by the .DXE file, which is not always the case.
You can read the symbol offset from the dxe file and subtract it from the pointer to get the address which can be freed. A simpler method might be to just copy the _dxe_load function and have it return the pointer. It was originally expected the load routine should be as tiny as possible, since it gets sucked into each image. Unless you load hundreds of them or they are huge, it's probably not worth messing with, since the default malloc wastes so much memory anyway.
I wrote a _dxe_unload function that simply reads the .DXE file and gets the symbol offset from there. I can't send it now, but I could put it online on my BBS (Fido node 2:332/437, 24h) and make it available for f/r. If you want to call, phone # is +39-51-781399 . I'll try to send it to someone that can upload it somewere, but I can't say how long it will take. :-( PS: I'm not sure of E-Mail address... If this doesen't work, try swapping 'f' and 'n' ...
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |