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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker.cc

Issue 1471683002: [StyleGuide] Allow begin and end non-member functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add link to discussion thread Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/heap_profiler_allocation_context_tracker.cc
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.cc b/base/trace_event/heap_profiler_allocation_context_tracker.cc
index b58fb60028fd1a641216e5fdd9b054ba99fb6be1..51e4590f9f08eb2e647fbbdd189ab0cd556ac5a4 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.cc
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.cc
@@ -5,6 +5,7 @@
#include "base/trace_event/heap_profiler_allocation_context_tracker.h"
#include <algorithm>
+#include <iterator>
#include "base/atomicops.h"
#include "base/threading/thread_local_storage.h"
@@ -25,13 +26,6 @@ void DestructAllocationContextTracker(void* alloc_ctx_tracker) {
delete static_cast<AllocationContextTracker*>(alloc_ctx_tracker);
}
-// Returns a pointer past the end of the fixed-size array |array| of |T| of
-// length |N|, identical to C++11 |std::end|.
-template <typename T, int N>
-T* End(T(&array)[N]) {
- return array + N;
-}
-
} // namespace
AllocationContextTracker::AllocationContextTracker() {}
@@ -99,9 +93,9 @@ AllocationContext AllocationContextTracker::GetContextSnapshot() {
// Fill the backtrace.
{
auto src = tracker->pseudo_stack_.begin();
- auto dst = ctx.backtrace.frames;
+ auto dst = std::begin(ctx.backtrace.frames);
auto src_end = tracker->pseudo_stack_.end();
- auto dst_end = End(ctx.backtrace.frames);
+ auto dst_end = std::end(ctx.backtrace.frames);
// Copy as much of the bottom of the pseudo stack into the backtrace as
// possible.
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698