Re: VC6 vs VC9
| From: | Evan Burkitt | Date: | Fri, 06 Feb 2009 20:37:18 +0000 |
| Subject: | Re: VC6 vs VC9 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-29153@lists.php.net to get a copy of this message | ||
""Louis Solomon [SteelBytes]"" <louis@steelbytes.com> wrote in message
news:C66C95C4B9354B6681CF7CC24F8F029B@steelbytes.local...
> Hi,
>
> based on comments on http://windows.php.net/qa/ ...
>
> why is the VC9 build compiled to used the CRT as DLLs instead of static?
> yet I gather the VC6 isn't?
I'm sure they both dynamically link to the CRT. When an application uses
numerous DLLs and they each dynamically load the CRT, the CRT code is loaded
once and all application binaries share a single memory heap. This means
memory can be malloc()ed in one DLL and free()d in another. A static link to
the CRT would not allow this, and would mean a copy of the CRT code would
exist in each DLL. (By 'not allow' I mean memory corruption and crashes.
Unfortunately the code will compile and link without incident.)
>
> why can't the VC9 build be used with apache.org binaries?
Apparently apache.org's binaries are compiled w/ VC6. Mixing
dynamically-loaded CRT versions creates a similar situation as statically
linking it: separate heaps, meaning cross-binary memory management will
cause heap corruption. Just as insidious is the possible difference in
object size between the two CRT versions. If DLL A assumes a certain object
is, say, 8 bytes and DLL B assumes 16 bytes, disaster is virtually assured.
-Evan