Skip to content

Commit

Permalink
timectxswws: Have the working set aligned on a page boundary.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuna committed Nov 15, 2010
1 parent 5ce1e3e commit 42610b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions timectxswws.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ int main(int argc, char** argv) {
free(buf);
}

const int shm_id = shmget(IPC_PRIVATE, sizeof (int) + ws_pages * 4096,
const int shm_id = shmget(IPC_PRIVATE, (ws_pages + 1) * 4096,
IPC_CREAT | 0666);
const pid_t other = fork();
int* futex = shmat(shm_id, NULL, 0);
void* ws = futex + 1;
void* ws = ((char *) futex) + 4096;
*futex = 0xA;
if (other == 0) {
for (int i = 0; i < iterations; i++) {
Expand Down

0 comments on commit 42610b7

Please sign in to comment.