Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: Customize operator new / delete Date: Mon, 16 May 2011 19:43:38 +1200 Lines: 27 Message-ID: <93c2tdFlpiU5@mid.individual.net> References: <78a4d447-9756-4dbc-ac6d-3513dbcd5031@l6g2000vbn.googlegroups.com> <4dc6cd28$0$38644$4fafbaef@reader1.news.tin.it> <4dca3b03$0$38643$4fafbaef@reader1.news.tin.it> <4dca40e0$0$18242$4fafbaef@reader2.news.tin.it> <053f6f0f-2caa-4fa3-b90d-2db959c12a28@d15g2000yqn.googlegroups.com> <1d442021-99b2-4fdd-bd66-506a57a07ae8@18g2000prd.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net E5QnqAskDfWtwZi3AcgV6Abe95DuTDVUgmJupZg6tl3GaKf9H9 Cancel-Lock: sha1:BunFudSZ/SUE+xiTUt9vlclB3uw= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: <1d442021-99b2-4fdd-bd66-506a57a07ae8@18g2000prd.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5009 On 05/16/11 06:54 PM, Joshua Maurice wrote: > On May 15, 6:14 am, James Kanze wrote: >> Except in very rare cases, you should not >> link the C++ standard library as a DLL, but statically. > > Wait what? IIRC, msvc in newer versions has even removed the option of > statically linking to the C++ standard library (the C runtime library > or whatever Microsoft calls it). > > Also, I know I've heard about fun results that can happen in Windows > if you have two different DLLs that both statically link to the C > runtime, and try to allocate memory in one DLL and free that object in > the other DLL. > > I just want to point out that your advice is clearly wrong for > Windows. As a programmer, one should educate oneself a bit about your > platform or platforms, and then make an informed decision. And that > informed decision will not /not/ be "almost always statically link > against the C++ standard library". That can be extrapolated to other platforms as well. There isn't a static C++ standard library provided for (Open)Solaris. Indeed if there were, it would make interposing user provided new and delete operator a lot harder. -- Ian Collins