// The same C under two C libraries (glibc linked dynamically, musl // statically): what startup, malloc and stdio turn into, seen as syscalls. #include #include #include // Volatile, or the compiler proves the allocations away. static char *volatile small, *volatile big; int main(void) { small = malloc(64); big = malloc(1 << 20); strcpy(small, "small"); memset(big, 'b', 1 << 20); printf("%s %c\n", small, big[4096]); free(big); free(small); return 0; }