Re: templates + RTTI + shared library = impossible?
On Jan 30, 9:32 pm, "BGB / cr88192" <cr88...@hotmail.com> wrote:
"Richard" <legalize+jee...@mail.xmission.com> wrote in message
news:hk1tta$jrg$1@news.xmission.com...
James Kanze <james.ka...@gmail.com> spake the secret code
<bf3a79e7-9307-44eb-8b60-4897105cd...@c4g2000yqa.googlegroups.com> thusly:
On Jan 29, 12:27 am, "BGB / cr88192" <cr88...@hotmail.com> wrote:
"Dan Caugherty" <dan.caughe...@gmail.com> wrote in message
similar issues can also manifest in other ways as well:
malloc/free not working between DLL's [...]
This is a purely Windows problem, present probably because
Windows doesn't bundle the CRT DLL's with the OS (I think). [...]
The issue is that each module (DLL or EXE) has its own Win32
heap. Memory allocated by a module will be allocated from
that module's heap and must be freed by code in that module
to be freed from the corect heap.
yeah.
No.
partial solution: don't pass memory ownership across DLL boundaries...
It's not a problem if you link your modules correctly.
but, yeah, DLL's do have at least the major good point of
avoiding lots of 10 or 20 MB EXE's (instead, one gets maybe
10-20 1 MB DLL's...), and a bunch of smaller EXE's...
So how is this a good point? You still end up with 10 or 20 MB
used on the disk, and you've made deployment significantly more
complicated, and introduced yet another way things can go wrong:
mixing versions of the DLL's. And of course, DLL's and
templates don't mix very well.
another good point, is that one need only remember to link in
those they need, and any others "come along for the ride",
which improves on the static-lib case, of having to remember
to link in every static lib referenced both directly and
indirectly, which can itself become a non-trivial problem.
Sorry, I don't understand this one. Are you using static libs,
or dynamically linked objects? What you (generally) want to
avoid is using a static library for something that will be used
from several different DLL's---that's what causes problems.
as well as simplifying dynamically-loadable components, ...
...
so, in general, they are a good tradeoff for their costs
(sometimes questionable linkage semantics, having to annotate
declarations, having to worry about moving around a small army
of DLL's and keeping them visible from the current directory,
...).
DLL's are an added complication. You use them when you need
them, but you should avoid them otherwise.
--
James Kanze