Bug 696162 - Followup: Use static_cast rather than reinterpret_cast, where appropriate.
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 24 Jan 2012 16:17:28 -0500
changeset 86499 0a4bc12a0d9870d4d48eb7f6c36cd21e9c6a6eba
parent 86498 23ec123586baa1ed8fe569d029ca61e2ad8e42e2
child 86500 5ab4319499522329fde5e0485ab134f7a0aff4e6
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs696162
milestone12.0a1
Bug 696162 - Followup: Use static_cast rather than reinterpret_cast, where appropriate.
js/src/jsgcchunk.cpp
--- a/js/src/jsgcchunk.cpp
+++ b/js/src/jsgcchunk.cpp
@@ -391,17 +391,17 @@ AllocChunk()
 inline static void *
 AllocChunkSlow()
 {
     /*
      * Map space for two chunks, then unmap around the result so we're left with
      * space for one chunk.
      */
 
-    char *p = reinterpret_cast<char*>(MapPages(NULL, ChunkSize * 2));
+    char *p = static_cast<char*>(MapPages(NULL, ChunkSize * 2));
     if (p == NULL)
         return NULL;
 
     size_t offset = ChunkAddrToOffset(p);
     if (offset == 0) {
         /* Trailing space only. */
         UnmapPages(p + ChunkSize, ChunkSize);
         return p;
@@ -429,17 +429,17 @@ AllocChunk()
      * jemalloc uses a heuristic in which we bypass the fast path if, last
      * time we called AllocChunk() on this thread, the fast path would have
      * failed.  But here in the js engine, we always try the fast path before
      * falling back to the slow path, because it's not clear that jemalloc's
      * heuristic is helpful to us.
      */
 
     /* Fast path; just allocate one chunk and hope it's aligned. */
-    char *p = reinterpret_cast<char*>(MapPages(NULL, ChunkSize));
+    char *p = static_cast<char*>(MapPages(NULL, ChunkSize));
     if (!p)
         return NULL;
 
     size_t offset = ChunkAddrToOffset(p);
     if (offset == 0) {
       /* Fast path worked! */
       return p;
     }