Re: [Dev-C++] dynamic allocation and structs
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2002-10-25 12:55:51
|
Since this is Dev-C++, i.e windows programing. The DLL is loaded in the memory space of your program. If multiple applications links to the same DLL, the DLL with "switch" between each applications memory space, depending on which application to make the call. The biggest problem with memory in a DLL is to have the DLL allocate C++ objects of new class types. You must export a static factory method, or global function for the allocation. There are a number of really good documents about this problem, but sorry, I don't have them accessible right now. /Per W On Fri, 25 Oct 2002, Abhijit Shylanath wrote: > Sorry if I'm converging, but I just found 2 cents in my hat... I remember > reading on the Allegro list that data alloc'ed in the Allegro DLL is not > accessible directly in the executable, so they use some fancy footwork to > manage all that. > > Isn't it unsafe to assume that the heap is shared across programs and > libraries? > > ___________________________________________________________ > > Abhijit Shylanath > > E-mail: mu...@gm... || ibr...@bi... > Web-site: http://mudeth.tripod.com/ > > > |