Bug 1249174 (part 7) - Only define XPTArena::name if XPT_ARENA_LOGGING is defined. r=khuey.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 23 Feb 2016 05:33:35 +1100
changeset 321860 fa81f18d5093d47064913e1e7fb6c54d03419df0
parent 321859 76740f3273fb519efe26f1dd345be20f5c9668d0
child 321861 d380cae049a102d96f94523fab6af90ae324a35a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1249174
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1249174 (part 7) - Only define XPTArena::name if XPT_ARENA_LOGGING is defined. r=khuey.
xpcom/typelib/xpt/xpt_arena.cpp
--- a/xpcom/typelib/xpt/xpt_arena.cpp
+++ b/xpcom/typelib/xpt/xpt_arena.cpp
@@ -84,19 +84,19 @@ struct BLK_HDR
 
 struct XPTArena
 {
     BLK_HDR *first;
     uint8_t *next;
     size_t   space;
     size_t   alignment;
     size_t   block_size;
-    char    *name;
 
 #ifdef XPT_ARENA_LOGGING
+    char    *name;
     uint32_t LOG_MallocCallCount;
     uint32_t LOG_MallocTotalBytesRequested;
     uint32_t LOG_MallocTotalBytesUsed;
     uint32_t LOG_FreeCallCount;
     uint32_t LOG_LoadingFreeCallCount;
     uint32_t LOG_RealMallocCallCount;
     uint32_t LOG_RealMallocTotalBytesRequested;
 #endif /* XPT_ARENA_LOGGING */
@@ -116,25 +116,25 @@ XPT_NewArena(uint32_t block_size, size_t
             block_size = XPT_MIN_BLOCK_SIZE;
         arena->block_size = ALIGN_RND(block_size, alignment);
 
         /* must have room for at least one item! */
         XPT_ASSERT(arena->block_size >= 
                    ALIGN_RND(sizeof(BLK_HDR), alignment) +
                    ALIGN_RND(1, alignment));
 
+#ifdef XPT_ARENA_LOGGING
         if (name) {
             arena->name = XPT_STRDUP(arena, name);           
-#ifdef XPT_ARENA_LOGGING
             /* fudge the stats since we are using space in the arena */
             arena->LOG_MallocCallCount = 0;
             arena->LOG_MallocTotalBytesRequested = 0;
             arena->LOG_MallocTotalBytesUsed = 0;
+        }
 #endif /* XPT_ARENA_LOGGING */
-        }
     }
     return arena;        
 }
 
 XPT_PUBLIC_API(void)
 XPT_DestroyArena(XPTArena *arena)
 {
     BLK_HDR* cur;