Mail Archives: djgpp/1995/11/29/13:23:06

Xref: comp.os.msdos.djgpp:3478
From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DXE questions
Date: Tue, 28 Nov 1995 07:42:07 CST
Organization: Rice University, Houston, Texas
Lines: 19
References: <49eean$5ec AT pith DOT uoregon DOT edu>
Reply-To: sandmann AT clio DOT rice DOT edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

> I know that multiple DXEs can be loaded simultaneously (I tested it).  My 
> question is this:  is there a way to free the memory occupied by a loaded DXE? 

Yes, but you have to do a tiny bit of work.  Look at the dxeload.c source.
As you can see, the returned pointer has the symbol offset added to the base
of the malloced block.  You must read the header in the DXE file yourself
(just swipe the code out of DXELOAD) and then subtract the offset from the
returned pointer.  Or you can just clone this entire routine and write your
own _dxe_load_2(name, &pointer) or something.  When I wrote this routine
I didn't think most people would be unloading it, and wanted the code to
be as small and simple as possible (since it gets sucked into every image
anyone writes...

> Thanks for your help.  BTW, I'm using the V2 beta, of course (isn't that the 
> only thing that supports DXEs?).

Actually, you should be able to compile the routines and use them under V1.x 
also, but I have been using V2 for about 18 months exclusively now and 
don't test under V1 anymore.

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019