cleanup: void_diff returns os_vm_size_t
[sbcl.git] / src / runtime / gencgc.c
index 3009904..62f5e8a 100644 (file)
@@ -254,8 +254,8 @@ npage_bytes(page_index_t npages)
 
 /* Check that X is a higher address than Y and return offset from Y to
  * X in bytes. */
-static inline
-size_t void_diff(void *x, void *y)
+static inline os_vm_size_t
+void_diff(void *x, void *y)
 {
     gc_assert(x >= y);
     return (pointer_sized_uint_t)x - (pointer_sized_uint_t)y;
@@ -498,18 +498,20 @@ write_generation_stats(FILE *file)
                 " %5"PAGE_INDEX_FMT" %5"PAGE_INDEX_FMT,
                 boxed_cnt, unboxed_cnt, large_boxed_cnt,
                 large_unboxed_cnt, pinned_cnt);
-        fprintf(file
-                " %8ld %5ld %8ld %4ld %3d %7.4f\n",
+        fprintf(file,
+                " %8"OS_VM_SIZE_FMT
+                " %5"OS_VM_SIZE_FMT
+                " %8"OS_VM_SIZE_FMT
+                " %4"PAGE_INDEX_FMT" %3d %7.4f\n",
                 generations[i].bytes_allocated,
-                (npage_bytes(count_generation_pages(i))
-                 - generations[i].bytes_allocated),
+                (npage_bytes(count_generation_pages(i)) - generations[i].bytes_allocated),
                 generations[i].gc_trigger,
                 count_write_protect_generation_pages(i),
                 generations[i].num_gc,
                 generation_average_age(i));
     }
-    fprintf(file,"   Total bytes allocated    = %lu\n", (unsigned long)bytes_allocated);
-    fprintf(file,"   Dynamic-space-size bytes = %lu\n", (unsigned long)dynamic_space_size);
+    fprintf(file,"   Total bytes allocated    = %"OS_VM_SIZE_FMT"\n", bytes_allocated);
+    fprintf(file,"   Dynamic-space-size bytes = %"OS_VM_SIZE_FMT"\n", dynamic_space_size);
 
     fpu_restore(fpu_state);
 }
@@ -787,7 +789,7 @@ gc_alloc_new_region(long nbytes, int page_type_flag, struct alloc_region *alloc_
 {
     page_index_t first_page;
     page_index_t last_page;
-    unsigned long bytes_found;
+    os_vm_size_t bytes_found;
     page_index_t i;
     int ret;
 
@@ -3996,7 +3998,7 @@ gc_free_heap(void)
     for (page = 0; page < page_table_pages; page++) {
         /* Skip free pages which should already be zero filled. */
         if (page_allocated_p(page)) {
-            void *page_start, *addr;
+            void *page_start;
             for (last_page = page;
                  (last_page < page_table_pages) && page_allocated_p(last_page);
                  last_page++) {