int main(void)
{
- size_t s = 0;
char *buf;
char dir = 1;
+ size_t s = 0;
for(size_t i = 1 << 31; i >= 1; i /= 2, free(buf))
dir = (buf = malloc(s += dir * i)) == NULL ? -1 : 1;
printf("One malloc can allocate at most %zu bytes\n", s);
+++ /dev/null
-#include <stdio.h>
-
-void function_b(void)
-{
- char buffer[4];
-
- printf("Executing function_b\n");
-}
-
-void function_a(void)
-{
- int beacon = 0xa0b1c2d3;
- printf("Executing function_a\n");
- function_b();
- printf("Executed function_b\n");
-}
-
-int main(void)
-{
- function_a();
- printf("Finished!\n");
- return 0;
-}