TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Coridon Henshaw
from: Jonathan de Boyne Pollard
date: 1996-03-11 01:32:36
subject: Wierd Watcom problem w/

CH>
  > My thinking is that the run-time library in the DLL doesn't
  > share it's [sic] memory arena information with the RTL in the
  > main EXE.
CH>

  This is indeed what is happening.

CH>
  >           If this is the case, the I believe that I have
  > found a workaround: use a function pointer to pass the
  > DLL's malloc calls back to the EXE so it can call malloc
  > directly.  I can use the workaround, but I'd rather fix
  > this problem properly, say, by using only one copy of the
  > RTL.
CH>

  That is not the correct solution.

  A DLL that allocates a resource, such as memory from a heap, and then
  passes that memory to its caller *must* provide a function to release
  that resource.

  It's symmetrical; it's neat.  Most of all, it reduces the coupling
  between the client and the DLL.

  Your solution (using a global C++ RTL) restricts your DLL to only being
  usable in applications written with *one* version of *one* C++ compiler.

  > JdeBP <
___
 X MegaMail 2.10 #0:
--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.