Skip to content

Commit

Permalink
Update move_pages.c
Browse files Browse the repository at this point in the history
fix bugs.
  • Loading branch information
foool authored and andikleen committed Jun 6, 2023
1 parent 2a04e8a commit 535d88e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/move_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ int main(int argc, char **argv)

printf("pages=%d (%s)\n", page_count, argv[1]);

page_base = malloc((pagesize + 1) * page_count);
page_base = malloc(pagesize * (page_count+1));
addr = malloc(sizeof(char *) * page_count);
status = malloc(sizeof(int *) * page_count);
nodes = malloc(sizeof(int *) * page_count);
status = malloc(sizeof(int) * page_count);
nodes = malloc(sizeof(int) * page_count);
if (!page_base || !addr || !status || !nodes) {
printf("Unable to allocate memory\n");
exit(1);
Expand Down

0 comments on commit 535d88e

Please sign in to comment.