[geeks] Prolog for network configuration
Tom Borton
tborton at usa.net
Thu Aug 8 14:35:19 CDT 2002
>From what I've seen of the Windows heap handlers, the problem is not so much
that MS makes it difficult - their new() and malloc() routines simply call the
Win32 API - but that the other compilers choose to have internal heap managers
that don't hit the Win32 API as often. The heap-related API calls are
relatively slow, and it's easier to recover the heap memory if the application
has just allocated one or two large chunks internally at startup and can
de-allocate them from the RTL during an exit.
That's why you have to worry about .DLLs - if they allocate straight from the
Windows heap and the process aborts, that memory gets lost because the RTL in
the main program knows nothing about it.
Tom
> -----Original Message-----
> From: geeks-admin at sunhelp.org
> [mailto:geeks-admin at sunhelp.org]On Behalf
> Of Joshua D Boyd
> Sent: 08 August 2002 14:38
> To: geeks at sunhelp.org
> Subject: Re: [geeks] Prolog for network configuration
>
> It seems that there are a minimum of 2 Microsoft provided malloc free
> sets. One for C and one used by new/delete (according to my memory of
> the article, which was in Windows Developer Magazine, the
> new/delete set
> were for some reason not built on top of the same malloc/free as the C
> one was). And then further, the malloc/frees used by Borland C++,
> mingw32, and cygwin are again all different. So, a DLL needs to find
> out what the application is using and use it. Otherwise, things are
> going to get seriously screwed up.
>
> One could argue about the idiocy of the other compilers not
> just sharing
> MSs malloc/free, but I think that MS makes it extremely difficult for
> them to do so.
More information about the geeks
mailing list