Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: third_party/tcmalloc/chromium/src/memory_region_map.h

Issue 14769008: Fix mmap region iteration while no regions are recorded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2006, Google Inc. 1 /* Copyright (c) 2006, 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
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 inline static void DoInsertRegionLocked(const Region& region); 354 inline static void DoInsertRegionLocked(const Region& region);
355 // Handle regions saved by InsertRegionLocked into a tmp static array 355 // Handle regions saved by InsertRegionLocked into a tmp static array
356 // by calling insert_func on them. 356 // by calling insert_func on them.
357 inline static void HandleSavedRegionsLocked( 357 inline static void HandleSavedRegionsLocked(
358 void (*insert_func)(const Region& region)); 358 void (*insert_func)(const Region& region));
359 359
360 // Restore buckets saved in a tmp static array by GetBucket to the bucket 360 // Restore buckets saved in a tmp static array by GetBucket to the bucket
361 // table where all buckets eventually should be. 361 // table where all buckets eventually should be.
362 static void RestoreSavedBucketsLocked(); 362 static void RestoreSavedBucketsLocked();
363 363
364 // Initialize RegionSet regions_.
365 inline static void InitRegionSetLocked();
366
364 // Wrapper around DoInsertRegionLocked 367 // Wrapper around DoInsertRegionLocked
365 // that handles the case of recursive allocator calls. 368 // that handles the case of recursive allocator calls.
366 inline static void InsertRegionLocked(const Region& region); 369 inline static void InsertRegionLocked(const Region& region);
367 370
368 // Record addition of a memory region at address "start" of size "size" 371 // Record addition of a memory region at address "start" of size "size"
369 // (called from our mmap/mremap/sbrk hooks). 372 // (called from our mmap/mremap/sbrk hooks).
370 static void RecordRegionAddition(const void* start, size_t size); 373 static void RecordRegionAddition(const void* start, size_t size);
371 // Record deletion of a memory region at address "start" of size "size" 374 // Record deletion of a memory region at address "start" of size "size"
372 // (called from our munmap/mremap/sbrk hooks). 375 // (called from our munmap/mremap/sbrk hooks).
373 static void RecordRegionRemoval(const void* start, size_t size); 376 static void RecordRegionRemoval(const void* start, size_t size);
(...skipping 29 matching lines...) Expand all
403 for (int index = 0; index < kHashTableSize; index++) { 406 for (int index = 0; index < kHashTableSize; index++) {
404 for (HeapProfileBucket* bucket = bucket_table_[index]; 407 for (HeapProfileBucket* bucket = bucket_table_[index];
405 bucket != NULL; 408 bucket != NULL;
406 bucket = bucket->next) { 409 bucket = bucket->next) {
407 callback(bucket, callback_arg); 410 callback(bucket, callback_arg);
408 } 411 }
409 } 412 }
410 } 413 }
411 414
412 #endif // BASE_MEMORY_REGION_MAP_H_ 415 #endif // BASE_MEMORY_REGION_MAP_H_
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/deep-heap-profile.cc ('k') | third_party/tcmalloc/chromium/src/memory_region_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698