delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/29/08:28:37

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" <jonpryor AT vt DOT edu>
To: "cygwin" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: malloc and free mixing in VC++ and cygwin
Date: Thu, 29 Apr 1999 08:26:48 -0400
MIME-Version: 1.0
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 <miko AT thetis DOT u-bourgogne DOT fr>
To: cygwin <cygwin AT sourceware DOT cygnus DOT com>
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

- Raw text -


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