#include // Test the maximum size of one linear block that is achievable with Linux // compile with gcc --static. #define SIZE 2943 unsigned char dummy1[1024UL*1024*SIZE/2]; unsigned char dummy2[1024UL*1024*SIZE/2]; int main(void) { if ((unsigned long)dummy2 != (unsigned long) ((&dummy1)+1)) { printf("dummy1 has address %lx, ends at %lxh.\n",dummy1, (&dummy1)+1); printf("dummy2 has address %lx.\n",dummy2); printf("duh. something went wrong.\n"); } else { printf("%d MB memory block starting at address %lxh available.\n", SIZE, (unsigned long)dummy1); } for(;;) sleep(100); return 0; }