Skip to content

Commit

Permalink
Fix getRedzoneSize which in most cases was underestimating (by a smal…
Browse files Browse the repository at this point in the history
…l ammount)

the distance between stack handler and signaller.
  • Loading branch information
eliotmiranda committed Feb 25, 2022
1 parent f779431 commit 41e16da
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion platforms/Mac OS/vm/sqMacMain.c
Expand Up @@ -1112,7 +1112,7 @@ getRedzoneSize()

do kill(getpid(),SIGPROF); while (!p);
(void)sigaction(SIGPROF, &old, 0);
return (char *)min(&old,&handler_action) - sizeof(struct sigaction) - p;
return (char *)min(&old,&handler_action) - p;
}

sqInt reportStackHeadroom;
Expand Down
2 changes: 1 addition & 1 deletion platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m
Expand Up @@ -473,7 +473,7 @@ Some of this code was funded via a grant from the European Smalltalk User Group

do kill(getpid(),SIGPROF); while (!p);
(void)sigaction(SIGPROF, &old, 0);
return (char *)min(&old,&handler_action) - sizeof(struct sigaction) - p;
return (char *)min(&old,&handler_action) - p;
}

static int stackPageHeadroom;
Expand Down
2 changes: 1 addition & 1 deletion platforms/minheadless/unix/sqPlatformSpecific-Unix.c
Expand Up @@ -196,7 +196,7 @@ getRedzoneSize()

do kill(getpid(),SIGPROF); while (!p);
(void)sigaction(SIGPROF, &old, 0);
return (char *)min(&old,&handler_action) - sizeof(struct sigaction) - p;
return (char *)min(&old,&handler_action) - p;
}

sqInt reportStackHeadroom;
Expand Down
2 changes: 1 addition & 1 deletion platforms/minheadless/windows/sqPlatformSpecific-Win32.c
Expand Up @@ -338,7 +338,7 @@ getRedzoneSize()

do kill(getpid(), SIGPROF); while (!p);
(void)sigaction(SIGPROF, &old, 0);
return (char *)min(&old, &handler_action) - sizeof(struct sigaction) - p;
return (char *)min(&old, &handler_action) - p;
#else /* cygwin */
void(*old)(int) = signal(SIGBREAK, sighandler);

Expand Down
2 changes: 1 addition & 1 deletion platforms/unix/vm/sqUnixMain.c
Expand Up @@ -2331,7 +2331,7 @@ getRedzoneSize()

do kill(getpid(),SIGPROF); while (!p);
(void)sigaction(SIGPROF, &old, 0);
return (char *)min(&old,&handler_action) - sizeof(struct sigaction) - p;
return (char *)min(&old,&handler_action) - p;
}

sqInt reportStackHeadroom;
Expand Down
2 changes: 1 addition & 1 deletion platforms/win32/vm/sqWin32Main.c
Expand Up @@ -2353,7 +2353,7 @@ getRedzoneSize()

do kill(getpid(),SIGPROF); while (!p);
(void)sigaction(SIGPROF, &old, 0);
return (char *)min(&old,&handler_action) - sizeof(struct sigaction) - p;
return (char *)min(&old,&handler_action) - p;
#else /* cygwin */
void (*old)(int) = signal(SIGBREAK, sighandler);

Expand Down

0 comments on commit 41e16da

Please sign in to comment.