delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/29/10:59:50

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
X-Authentication-Warning: modi.xraylith.wisc.edu: khan owned process doing -bs
Date: Thu, 29 Apr 1999 09:51:01 -0500 (CDT)
From: Mumit Khan <khan AT xraylith DOT wisc DOT edu>
To: cygwin <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: malloc and free mixing in VC++ and cygwin
In-Reply-To: <09e101be923b$a1f44aa0$e63d2509@jonpryor.raleigh.ibm.com>
Message-ID: <Pine.SUN.3.93.990429094840.5133F-100000@modi.xraylith.wisc.edu>
MIME-Version: 1.0

On Thu, 29 Apr 1999, Jonathan Pryor wrote:

> However, that doesn't mean that you can't have one environment
> allocate memory, and have the other free it -- you just can't
> use the C runtime functions.

This is the key issue -- Cannot use C runtime functions from *both*
the runtime libraries, just use one or the other. This goes for
more than just the memory (de)allocation routines.

> 
> The Win32 functions CoTaskMemAlloc() and CoTaskMemFree() can
> be used to allocate/free memory between 2 otherwise incompatible
> memory schemes.  I suspect that most of the other Win32 memory
> functions (GlobalAlloc/GlobalFree, etc.) could also be used
> to do this as well.

My experience as well. As long as you stick to Win32 API, you're 
completely safe.

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019