OLD | NEW |
1 // Copyright (c) 2012, Google Inc. | 1 // Copyright (c) 2005, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
11 // copyright notice, this list of conditions and the following disclaimer | 11 // copyright notice, this list of conditions and the following disclaimer |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 }; | 300 }; |
301 virtual Ownership GetOwnership(const void* p); | 301 virtual Ownership GetOwnership(const void* p); |
302 | 302 |
303 // The current malloc implementation. Always non-NULL. | 303 // The current malloc implementation. Always non-NULL. |
304 static MallocExtension* instance(); | 304 static MallocExtension* instance(); |
305 | 305 |
306 // Change the malloc implementation. Typically called by the | 306 // Change the malloc implementation. Typically called by the |
307 // malloc implementation during initialization. | 307 // malloc implementation during initialization. |
308 static void Register(MallocExtension* implementation); | 308 static void Register(MallocExtension* implementation); |
309 | 309 |
310 // On the current thread, return the total number of bytes allocated. | |
311 // (Currently only implemented in tcmalloc.) | |
312 static unsigned int GetBytesAllocatedOnCurrentThread(); | |
313 | |
314 // Returns detailed information about malloc's freelists. For each list, | 310 // Returns detailed information about malloc's freelists. For each list, |
315 // return a FreeListInfo: | 311 // return a FreeListInfo: |
316 struct FreeListInfo { | 312 struct FreeListInfo { |
317 size_t min_object_size; | 313 size_t min_object_size; |
318 size_t max_object_size; | 314 size_t max_object_size; |
319 size_t total_bytes_free; | 315 size_t total_bytes_free; |
320 const char* type; | 316 const char* type; |
321 }; | 317 }; |
322 // Each item in the vector refers to a different freelist. The lists | 318 // Each item in the vector refers to a different freelist. The lists |
323 // are identified by the range of allocations that objects in the | 319 // are identified by the range of allocations that objects in the |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 391 |
396 // Perhaps add the following: | 392 // Perhaps add the following: |
397 // - stack trace if this range was sampled | 393 // - stack trace if this range was sampled |
398 // - heap growth stack trace if applicable to this range | 394 // - heap growth stack trace if applicable to this range |
399 // - age when allocated (for inuse) or freed (if not in use) | 395 // - age when allocated (for inuse) or freed (if not in use) |
400 }; | 396 }; |
401 | 397 |
402 } // namespace base | 398 } // namespace base |
403 | 399 |
404 #endif // BASE_MALLOC_EXTENSION_H_ | 400 #endif // BASE_MALLOC_EXTENSION_H_ |
OLD | NEW |