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 Message-ID: <09e101be923b$a1f44aa0$e63d2509@jonpryor.raleigh.ibm.com> From: "Jonathan Pryor" To: "cygwin" Subject: Re: malloc and free mixing in VC++ and cygwin Date: Thu, 29 Apr 1999 08:26:48 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Maybe. :) More precisly, can `malloc' be used to allocate memory in cygwin and `free' be used in VC to free the cygwin-allocated memory? No -- they use different memory schemes. 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. 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. hth - Jon -----Original Message----- From: Dominique MICOLLET To: cygwin Date: Thursday, April 29, 1999 4:34 AM Subject: malloc and free mixing in VC++ and cygwin >Hello, > >I browse both FAQ, Users Manual and mailing list archive but was unable to >find the answer to the following question : > >- is it possible to malloc a buffer within a cygwin procedure and free this >buffer within a VC++ procedure ? >- and inversely ? > >I suspect no, but I wish a confirmation. > > Cordialement > >Dominique MICOLLET Email : Dominique DOT Micollet AT u-bourgogne DOT fr >Laboratoire LE2I Universite de Bourgogne >9, Avenue Alain SAVARY BP 400 Tel : +33/(0)3-80-39-59-27 >21011 DIJON CEDEX FRANCE Tfx : +33/(0)3-80-39-68-69 -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com