Memory allocation with DLL version of C-RTL, how can I do it?

Memory allocation with DLL version of C-RTL, how can I do it?

Post by sayo » Sun, 11 Nov 2001 01:13:07



Memory allocation with DLL version of C-RTL, how can I do it?

Hi guys,

I have a problem with memory allocation, I allocate memory in my .dll
and free it in my .exe.(in c++ with VS5) And because of they
dont use the same heap, SO it wont work As I know
it is possible to make it works if the dll and the exe use (link with)
the same C runtime library (DLL version of the C runtime library). But
the problem is I dont know how to get the C RTL, and how to use
it in my code.and does this solution works for the UNIX system
also???

Thanks!!!!

sayoyo

 
 
 

Memory allocation with DLL version of C-RTL, how can I do it?

Post by Joe Halpi » Sun, 11 Nov 2001 01:31:54



> I have a problem with memory allocation, I allocate memory in my
> .dll and free it in my .exe.(in c++ with VS5) And because of they
> don’t use the same heap, SO it won’t work… As I
> know it is possible to make it works if the dll and the exe use
> (link with) the same C runtime library (DLL version of the C runtime
> library). But the problem is I don’t know how to get the C
> RTL, and how to use it in my code….and does this solution
> works for the UNIX system also???

In Unix, there is only one heap for a process. When you link with a
shared library (DLL in MS-speak) you get a copy of the shared library
data in your program's memory space, which is distinct from any other
memory space, so it doesn't matter (unless, of course, the library
isn't expecting you to free memory that it allocated :-).

I thought MS had fixed that broken strategy?

Joe
--
Remember Flight 93

 
 
 

1. Memory allocation with DLL version of C-RTL, how can I do it?

Hi guys,

I have a problem with memory allocation, I allocate memory in my
.so/.a and free it in my .exe.(in c++ with VS5) And because of they
dont use the same heap, SO it wont work As I know
it is possible to make it works if the dll and the exe use (link with)
the same C runtime library (DLL version of the C runtime library). But
the problem is I dont know how to get the C RTL, and how to use
it in my code.and does this solution works for the UNIX system
also???

Thanks!!!!

sayoyo

2. Recursive grep

3. Memory allocation and de-allocation

4. General Graphics/Input Interface 2.0

5. Debug version of Memory Allocation

6. Machines misreporting Bogomips

7. memory allocation by OS memory manager

8. Reading is much more interesting than TV (0191/1708)

9. Infinite memory?!? Memory allocation bug with gcc?

10. Ethereal on cygwin - 'which Packet.dll' and 'which wpcap.dll' ??

11. Unidrv.dll & Mmsystem.dll

12. "Doing DLL's" in Linux?

13. libXpm-3.4 (DLL version 4.0) for linux is available