Skip to content

Commit 42610b7

Browse files
committed
timectxswws: Have the working set aligned on a page boundary.
1 parent 5ce1e3e commit 42610b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

timectxswws.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ int main(int argc, char** argv) {
5454
free(buf);
5555
}
5656

57-
const int shm_id = shmget(IPC_PRIVATE, sizeof (int) + ws_pages * 4096,
57+
const int shm_id = shmget(IPC_PRIVATE, (ws_pages + 1) * 4096,
5858
IPC_CREAT | 0666);
5959
const pid_t other = fork();
6060
int* futex = shmat(shm_id, NULL, 0);
61-
void* ws = futex + 1;
61+
void* ws = ((char *) futex) + 4096;
6262
*futex = 0xA;
6363
if (other == 0) {
6464
for (int i = 0; i < iterations; i++) {

0 commit comments

Comments
 (0)