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

Side by Side Diff: third_party/tcmalloc/chromium/src/span.cc

Issue 9311003: Update the tcmalloc chromium branch to r144 (gperftools 2.0), and merge chromium-specific changes. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasec Created 8 years, 9 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) 2008, Google Inc. 1 // Copyright (c) 2008, 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 int DLL_Length(const Span* list) { 84 int DLL_Length(const Span* list) {
85 int result = 0; 85 int result = 0;
86 for (Span* s = list->next; s != list; s = s->next) { 86 for (Span* s = list->next; s != list; s = s->next) {
87 result++; 87 result++;
88 } 88 }
89 return result; 89 return result;
90 } 90 }
91 91
92 #if 0 // This isn't used. If that changes, rewrite to use TCMalloc_Printer.
93 void DLL_Print(const char* label, const Span* list) {
94 MESSAGE("%-10s %p:", label, list);
95 for (const Span* s = list->next; s != list; s = s->next) {
96 MESSAGE(" <%p,%"PRIuPTR",%"PRIuPTR">", s, s->start, s->length);
97 }
98 MESSAGE("%s\n", ""); // %s is to get around a compiler error.
99 }
100 #endif
101
102 void DLL_Prepend(Span* list, Span* span) { 92 void DLL_Prepend(Span* list, Span* span) {
103 ASSERT(span->next == NULL); 93 ASSERT(span->next == NULL);
104 ASSERT(span->prev == NULL); 94 ASSERT(span->prev == NULL);
105 span->next = list->next; 95 span->next = list->next;
106 span->prev = list; 96 span->prev = list;
107 list->next->prev = span; 97 list->next->prev = span;
108 list->next = span; 98 list->next = span;
109 } 99 }
110 100
111 } // namespace tcmalloc 101 } // namespace tcmalloc
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/span.h ('k') | third_party/tcmalloc/chromium/src/stack_trace_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698