equal
deleted
inserted
replaced
155 // Transition the tracking level to specified level |
155 // Transition the tracking level to specified level |
156 static bool transition_to(NMT_TrackingLevel level); |
156 static bool transition_to(NMT_TrackingLevel level); |
157 |
157 |
158 static inline void* record_malloc(void* mem_base, size_t size, MEMFLAGS flag, |
158 static inline void* record_malloc(void* mem_base, size_t size, MEMFLAGS flag, |
159 const NativeCallStack& stack, NMT_TrackingLevel level) { |
159 const NativeCallStack& stack, NMT_TrackingLevel level) { |
160 return MallocTracker::record_malloc(mem_base, size, flag, stack, level); |
160 if (level != NMT_off) { |
|
161 return MallocTracker::record_malloc(mem_base, size, flag, stack, level); |
|
162 } |
|
163 return mem_base; |
161 } |
164 } |
162 |
165 |
163 static inline size_t malloc_header_size(NMT_TrackingLevel level) { |
166 static inline size_t malloc_header_size(NMT_TrackingLevel level) { |
164 return MallocTracker::malloc_header_size(level); |
167 return MallocTracker::malloc_header_size(level); |
165 } |
168 } |
175 // of malloc tracking header if tracking is enabled. |
178 // of malloc tracking header if tracking is enabled. |
176 // Otherwise, it returns the same address. |
179 // Otherwise, it returns the same address. |
177 static void* malloc_base(void* memblock); |
180 static void* malloc_base(void* memblock); |
178 |
181 |
179 // Record malloc free and return malloc base address |
182 // Record malloc free and return malloc base address |
180 static inline void* record_free(void* memblock) { |
183 static inline void* record_free(void* memblock, NMT_TrackingLevel level) { |
|
184 // Never turned on |
|
185 if (level == NMT_off || memblock == NULL) { |
|
186 return memblock; |
|
187 } |
181 return MallocTracker::record_free(memblock); |
188 return MallocTracker::record_free(memblock); |
182 } |
189 } |
183 |
190 |
184 |
191 |
185 // Record creation of an arena |
192 // Record creation of an arena |