Replace quick_sort() that uses quick sort and O(lg n) space
[pintos-anon] / grading / vm / page-merge-par.c
index 5c5d62bde778e4c53cc33239efe975b23bb27f59..8f3be48cbb64816ab0860f22de9b19a5baaa2935 100644 (file)
@@ -7,7 +7,10 @@
 #endif
 #include "../lib/arc4.h"
 
-#define CHUNK_SIZE (63 * 1024)                  /* Max file size. */
+/* This is the max file size for an older version of the Pintos
+   file system that had 126 direct blocks each pointing to a
+   single disk sector.  We could raise it now. */
+#define CHUNK_SIZE (126 * 512)
 #define CHUNK_CNT 8                             /* Number of chunks. */
 #define DATA_SIZE (CHUNK_CNT * CHUNK_SIZE)      /* Buffer size. */
 
@@ -32,7 +35,7 @@ init (void)
 
 /* Sort each chunk of buf1 using a subprocess. */
 static void
-sort (void)
+sort_chunks (void)
 {
   pid_t children[CHUNK_CNT];
   size_t i;
@@ -159,7 +162,7 @@ main (void)
 {
   printf ("(page-merge-par) begin\n");
   init ();
-  sort ();
+  sort_chunks ();
   merge ();
   verify ();
   printf ("(page-merge-par) end\n");