Cygwin: Fixing the math behind rounding down ch.stacklimit to page size.
This commit is contained in:
parent
53960db861
commit
06797545b3
@ -316,7 +316,7 @@ frok::parent (volatile char * volatile stack_here)
|
|||||||
on whether we're running on a pthread or not. If pthread, we fetch
|
on whether we're running on a pthread or not. If pthread, we fetch
|
||||||
the guardpage size from the pthread attribs, otherwise we use the
|
the guardpage size from the pthread attribs, otherwise we use the
|
||||||
system default. */
|
system default. */
|
||||||
ch.stacklimit = (void *) ((uintptr_t) stack_here & ~wincap.page_size ());
|
ch.stacklimit = (void *) ((uintptr_t) stack_here & ~(wincap.page_size () - 1));
|
||||||
ch.guardsize = (&_my_tls != _main_tls && _my_tls.tid)
|
ch.guardsize = (&_my_tls != _main_tls && _my_tls.tid)
|
||||||
? _my_tls.tid->attr.guardsize
|
? _my_tls.tid->attr.guardsize
|
||||||
: wincap.def_guard_page_size ();
|
: wincap.def_guard_page_size ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user