Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92e4dd8

Browse files
committed
s/_alloca/alloca/g; Windows doesn't need the former, at least not unless
__STDC__ is defined (or something like that ...).
1 parent 0f34556 commit 92e4dd8

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Modules/posixmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3606,7 +3606,7 @@ _PyPopenCreateProcess(char *cmdstring,
36063606
if (i = GetEnvironmentVariable("COMSPEC",NULL,0)) {
36073607
char *comshell;
36083608

3609-
s1 = (char *)_alloca(i);
3609+
s1 = (char *)alloca(i);
36103610
if (!(x = GetEnvironmentVariable("COMSPEC", s1, i)))
36113611
return x;
36123612

@@ -3622,7 +3622,7 @@ _PyPopenCreateProcess(char *cmdstring,
36223622
_stricmp(comshell, "command.com") != 0) {
36233623
/* NT/2000 and not using command.com. */
36243624
x = i + strlen(s3) + strlen(cmdstring) + 1;
3625-
s2 = (char *)_alloca(x);
3625+
s2 = (char *)alloca(x);
36263626
ZeroMemory(s2, x);
36273627
PyOS_snprintf(s2, x, "%s%s%s", s1, s3, cmdstring);
36283628
}
@@ -3675,7 +3675,7 @@ _PyPopenCreateProcess(char *cmdstring,
36753675
strlen(modulepath) +
36763676
strlen(szConsoleSpawn) + 1;
36773677

3678-
s2 = (char *)_alloca(x);
3678+
s2 = (char *)alloca(x);
36793679
ZeroMemory(s2, x);
36803680
/* To maintain correct argument passing semantics,
36813681
we pass the command-line as it stands, and allow

Python/pythonrun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,9 +1450,9 @@ int
14501450
PyOS_CheckStack(void)
14511451
{
14521452
__try {
1453-
/* _alloca throws a stack overflow exception if there's
1453+
/* alloca throws a stack overflow exception if there's
14541454
not enough space left on the stack */
1455-
_alloca(PYOS_STACK_MARGIN * sizeof(void*));
1455+
alloca(PYOS_STACK_MARGIN * sizeof(void*));
14561456
return 0;
14571457
} __except (EXCEPTION_EXECUTE_HANDLER) {
14581458
/* just ignore all errors */

0 commit comments

Comments
 (0)