mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
multiple of the page size had an off by one error. Fixed it to use the PGROUNDUP macro instead of trying to do the calculation itself and then get it wrong. BUG: 93309 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3030
35 lines
604 B
C
35 lines
604 B
C
#include <inttypes.h>
|
|
#include <pthread.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
static void *thread_main(void *arg)
|
|
{
|
|
uintptr_t address = (uintptr_t)&arg;
|
|
|
|
printf("alignment = %" PRIuPTR "\n", address & 3U);
|
|
|
|
return NULL;
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
pthread_t t;
|
|
int e;
|
|
|
|
if ((e = pthread_create(&t, NULL, thread_main, NULL)) != 0)
|
|
{
|
|
fprintf(stderr, "pthread_create: %s\n", strerror(e));
|
|
exit(1);
|
|
}
|
|
|
|
if ((e = pthread_join(t, NULL)) != 0)
|
|
{
|
|
fprintf(stderr, "pthread_join: %s\n", strerror(e));
|
|
exit(1);
|
|
}
|
|
|
|
exit(0);
|
|
}
|