mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
test-sizeof: show stack and heap randomization
It's useful to reassure yourself those those things actually work ;)
This commit is contained in:
parent
5f1d6ebd2a
commit
75c293f37d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user