This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mmap() on 64K aligned address fails


Samuel Thibault wrote:
[snip]
> This seems odd. In the cygwin case, pagesize() would not be sufficient ??

No, in windows there is a requirement that mmap uses memory aligned to 64k (the
infamous granularity).

> And anyway, it should rather be 
>    data2 = (char *) malloc (2 * 16 * pagesize);
> Not only 16 (since it is further 16*pagesize -aligned).

It's enough to allocate 16 x pagesize to use one page for mmap-ing (like Corinna
said in one message 15/16 pages will not be aligned -- but one will).  If you
see the intermediate results I printed, data2 is re-aligned to 64k correctly.

Anyway, I still don't know why mmap() failded.
-- 
René Berber


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]