> while(1) {
>    int *b = alloca(4);
> }
> will run out of memory eventually, while
No, at the begining of block we will restore a stack if we handle
alloca like VLA
Can you point to the standard for the alloca()? And what happens when
we leave a block?

> while(1) {
>    int b[function_returning_1()];
>    printf("%p\n", b);
> }
> mustn't run out of memory.
Proof? What happens if function_returning_1() will return (unsigned
long)(void *)-1 ?

A test for your first example:
int x = 4;
while(1) {
    int *b = alloca(4);
    int vla[x];
}
A stack will be restored, alloca() will NOT run out of memory.
Why a different semantic which depends on the context?

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to