More changes to 32/64 bit correctness.
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 28 Sep 2010 12:18:19 +0000 (12:18 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 28 Sep 2010 12:18:19 +0000 (12:18 +0000)
TBR=vegorov
Review URL: http://codereview.chromium.org/3412038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/log.cc
src/log.h
src/utils.h

index 5c70057..75674f7 100644 (file)
@@ -1005,11 +1005,12 @@ void Logger::HeapSampleBeginEvent(const char* space, const char* kind) {
 
 
 void Logger::HeapSampleStats(const char* space, const char* kind,
-                             int capacity, int used) {
+                             intptr_t capacity, intptr_t used) {
 #ifdef ENABLE_LOGGING_AND_PROFILING
   if (!Log::IsEnabled() || !FLAG_log_gc) return;
   LogMessageBuilder msg;
-  msg.Append("heap-sample-stats,\"%s\",\"%s\",%d,%d\n",
+  msg.Append("heap-sample-stats,\"%s\",\"%s\","
+                 "%" V8_PTR_PREFIX "d,%" V8_PTR_PREFIX "d\n",
              space, kind, capacity, used);
   msg.WriteToLogFile();
 #endif
index 2534e1e..742a66f 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -237,7 +237,7 @@ class Logger {
   static void HeapSampleJSProducerEvent(const char* constructor,
                                         Address* stack);
   static void HeapSampleStats(const char* space, const char* kind,
-                              int capacity, int used);
+                              intptr_t capacity, intptr_t used);
 
   static void SharedLibraryEvent(const char* library_path,
                                  uintptr_t start,
index 3525c98..ffdb639 100644 (file)
@@ -224,16 +224,18 @@ uint32_t ComputeIntegerHash(uint32_t key);
 
 #if __GNUC__ >= 4
 // On gcc we can ask the compiler to check the types of %d-style format
-// specifiers and their associated arguments.
+// specifiers and their associated arguments.  TODO(erikcorry) fix this
+// so it works on MacOSX.
+#if defined(__MACH__) && defined(__APPLE__)
+#define PRINTF_CHECKING
+#else  // MacOsX.
 #define PRINTF_CHECKING __attribute__ ((format (printf, 1, 2)))
+#endif
 #else
 #define PRINTF_CHECKING
 #endif
 
-// Our version of printf(). Avoids compilation errors that we get
-// with standard printf when attempting to print pointers, etc.
-// (the errors are due to the extra compilation flags, which we
-// want elsewhere).
+// Our version of printf().
 void PRINTF_CHECKING PrintF(const char* format, ...);
 
 // Our version of fflush.