From: Nikodemus Siivola Date: Fri, 25 Nov 2011 12:53:22 +0000 (+0200) Subject: cleanup: #define and use OS_VM_SIZE_FMT in write_generation_stats X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=df9e151e5c81ac2716011c246c0e62848527b9b3;p=sbcl.git cleanup: #define and use OS_VM_SIZE_FMT in write_generation_stats --- diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 9ba41fb..652733f 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -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); } diff --git a/src/runtime/os.h b/src/runtime/os.h index 814b18d..8384ef3 100644 --- a/src/runtime/os.h +++ b/src/runtime/os.h @@ -179,4 +179,14 @@ int os_get_errno(void); * returned, it must be 'free'd. */ extern char *os_get_runtime_executable_path(int external_path); +/* Write platforms specific ones when necessary. This is to get us off + * the ground. */ +#if N_WORD_BITS == 32 +# define OS_VM_SIZE_FMT "u" +# define OS_VM_SIZE_FMTX "x" +#else +# define OS_VM_SIZE_FMT "lu" +# define OS_VM_SIZE_FMTX "lx" +#endif + #endif