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 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: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.9i-nntp X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/