test-sizeof: show stack and heap randomization

It's useful to reassure yourself those those things actually work ;)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-11-26 10:28:18 +01:00
parent 5f1d6ebd2a
commit 75c293f37d

View File

@ -93,5 +93,13 @@ int main(void) {
printf("timeval: %zu\n", sizeof(struct timeval));
printf("timespec: %zu\n", sizeof(struct timespec));
void *x = malloc(100);
printf("local variable: %p\n", &function_pointer);
printf("glibc function: %p\n", memcpy);
printf("heap allocation: %p\n", x);
free(x);
return 0;
}