delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/11/26/13:03:47

X-Spam-Check-By: sourceware.org
X-Cloudmark-Score: 0.000000 []
X-T2-Posting-ID: dCnToGxhL58ot4EWY8b+QGwMembwLoz1X2yB7MdtIiA=
Date: Sat, 26 Nov 2005 19:03:31 +0100
From: Samuel Thibault <samuel DOT thibault AT ens-lyon DOT org>
To: cygwin AT cygwin DOT com
Subject: Re: mmap() on 64K aligned address fails
Message-ID: <20051126180331.GI5074@bouh.residence.ens-lyon.fr>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <dm8oki$48t$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
In-Reply-To: <dm8oki$48t$1@sea.gmane.org>
User-Agent: Mutt/1.5.9i-nntp
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

René Berber, le Fri 25 Nov 2005 22:34:26 -0600, a écrit :
> #if !defined(__CYGWIN32__)
>   data2 = (char *) malloc (2 * pagesize);
>   if (!data2) {
>     printf("second malloc failed\n");
>     exit (1);
>   }
>   data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
> #else
>   data2 = (char *) malloc (16 * pagesize);
>   if (!data2) {
>     printf("second malloc failed\n");
>     exit (1);
>   }
>   printf("data2 before is %p\n", data2);
>   data2 += (16*pagesize - ((long) data2 & (16*pagesize - 1))) & (16*pagesize - 1);
>   printf("data2 after  is %p\n", data2);
> #endif

This seems odd. In the cygwin case, pagesize() would not be sufficient ??
And anyway, it should rather be 
   data2 = (char *) malloc (2 * 16 * pagesize);
Not only 16 (since it is further 16*pagesize -aligned).

Regards,
Samuel


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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