Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: STL objects...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 24 Topic 45764 of 47031
Post > Topic >>

Re: STL objects and binary compatibility

by Joe Greer <jgreer@[EMAIL PROTECTED] > May 8, 2008 at 05:02 PM

osama178@[EMAIL PROTECTED]
 wrote in
news:740ee874-4c83-42a5-8bcd-5dad161e1f38@[EMAIL PROTECTED]
 

> Thank you all for responding. Your input helped clear things a lot.
> 
>> Along those same lines, if you plan on
>> unloading your dlls make very sure that every object allocated from
>> that dll has been destroyed first or you will get a fault when you
>> eventually do get around to destroying those objects.  Something
>> about the destructors not being loaded into memory any more makes the
>> system get upset. :) 
> 
> This excerpt from Effective C++, Iterm 18 adds to what you said:
> 
> "An especially nice feature of tr1::shared_ptr is that it
> automatically uses its per-pointer deleter to eliminate another
> potential client error, the "cross-DLL problem."  This problem crops
> up when an object is created using new in one dynamically linked
> library (DLL) but is deleted in a different DLL.  On many platforms,
> such cross-DLL new/delete pairs lead to runtime errors.
> tr1:;shared_ptr avoids the problem, because its default deleter uses
> delete from the same DLL where the tr1::shared_ptr is created."
> 

And that is true. The problem with STL collections is that they can sneak 
an allocation in on you for one of their internal structures and the 
current versions don't take any steps to guarantee that the internal 
structure gets deleted where it was allocated.  AFAIK, this is a problem 
only for cl***** where the implementation is all in the header, allowing 
for the inlining of methods that may allocate memory.

joe
 




 24 Posts in Topic:
STL objects and binary compatibility
osama178@[EMAIL PROTECTED  2008-05-05 20:40:22 
Re: STL objects and binary compatibility
Gianni Mariani <gi4nos  2008-05-06 05:56:23 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-06 02:52:52 
Re: STL objects and binary compatibility
osama178@[EMAIL PROTECTED  2008-05-06 10:29:14 
Re: STL objects and binary compatibility
Gianni Mariani <gi4nos  2008-05-06 19:10:54 
Re: STL objects and binary compatibility
Ian Collins <ian-news@  2008-05-07 07:34:57 
Re: STL objects and binary compatibility
Joe Greer <jgreer@[EMA  2008-05-07 15:12:14 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-07 02:08:24 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-08 16:08:06 
Re: STL objects and binary compatibility
osama178@[EMAIL PROTECTED  2008-05-07 14:23:58 
Re: STL objects and binary compatibility
Joe Greer <jgreer@[EMA  2008-05-08 17:02:15 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-09 05:20:59 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-12 01:15:39 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-12 02:57:18 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-12 18:35:10 
Re: STL objects and binary compatibility
Triple-DES <DenPlettfr  2008-05-12 22:36:30 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-13 03:10:55 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-13 03:20:37 
Re: STL objects and binary compatibility
Paavo Helde <nobody@[E  2008-05-13 12:27:43 
Re: STL objects and binary compatibility
"kwikius" <a  2008-05-13 20:19:35 
Re: STL objects and binary compatibility
ajalkane <ajalkane@[EM  2008-05-13 21:57:04 
Re: STL objects and binary compatibility
Ian Collins <ian-news@  2008-05-14 17:34:59 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-14 02:04:10 
Re: STL objects and binary compatibility
James Kanze <james.kan  2008-05-14 02:13:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:44:39 CDT 2008.