[PATCH] Cygwin: mmap: use 64K pages for bookkeeping
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed Jan 22 10:20:55 GMT 2025
On Jan 20 10:36, Ken Brown wrote:
> On 1/20/2025 6:49 AM, Corinna Vinschen wrote:
> > Nice idea, but this may not do what is expected if the mapping is an
> > anonymous mapping, leaving the protection or mapping of trailing pages
> > in a wrong state, isn't it?
> >
> > Can we easily make sure the type of mapping (file vs anon) is known
> > at the time of rounding, so the rounding is performed differently?
> I hadn't thought of that. Actually, I *think* the record length is already
> a multiple of 64K for an anonymous mapping.
You're right, of course. For an anonymous mapping, mmap() forces len to
be a multiple of wincap.allocation_granularity() anyway.
So yeah, looks like your previous patch does the trick. Feel free to
push it, but I would love to see a comment in mmap_record::match() to
explain why we do it this way.
Thanks,
Corinna
More information about the Cygwin-patches
mailing list