mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-25 12:00:31 +00:00
Increase stack size to 128k and guard size to 16k
This improves our compatibility with Apple M1.
This commit is contained in:
parent
57c0dcdc29
commit
dd04aeba1c
36 changed files with 109 additions and 125 deletions
|
@ -1458,7 +1458,7 @@ static textstartup void __asan_shadow_mapping(struct MemoryIntervals *m,
|
|||
static textstartup void __asan_shadow_existing_mappings(void) {
|
||||
__asan_shadow_mapping(&_mmi, 0);
|
||||
__asan_map_shadow(GetStackAddr(), GetStackSize());
|
||||
__asan_poison((void *)GetStackAddr(), PAGESIZE, kAsanStackOverflow);
|
||||
__asan_poison((void *)GetStackAddr(), GUARDSIZE, kAsanStackOverflow);
|
||||
}
|
||||
|
||||
__attribute__((__constructor__)) void __asan_init(int argc, char **argv,
|
||||
|
@ -1482,7 +1482,7 @@ __attribute__((__constructor__)) void __asan_init(int argc, char **argv,
|
|||
__asan_shadow_existing_mappings();
|
||||
__asan_map_shadow((uintptr_t)_base, _end - _base);
|
||||
__asan_map_shadow(0, 4096);
|
||||
__asan_poison(0, PAGESIZE, kAsanNullPage);
|
||||
__asan_poison(0, GUARDSIZE, kAsanNullPage);
|
||||
if (!IsWindows()) {
|
||||
__sysv_mprotect((void *)0x7fff8000, 0x10000, PROT_READ);
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@ noasan void *_extend(void *p, size_t n, void *e, int f, intptr_t h) {
|
|||
char *q;
|
||||
_unassert(!((uintptr_t)SHADOW(p) & (G - 1)));
|
||||
_unassert((uintptr_t)p + (G << kAsanScale) <= h);
|
||||
// TODO(jart): Make this spin less in non-ASAN mode.
|
||||
for (q = e; q < ((char *)p + n); q += 8) {
|
||||
if (!((uintptr_t)q & (G - 1))) {
|
||||
_unassert(q + G <= (char *)h);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue