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

Side by Side Diff: runtime/vm/freelist.cc

Issue 10869063: Add attributions so printf like functions can have their arguments checked. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 3 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/freelist.h" 5 #include "vm/freelist.h"
6 6
7 #include "vm/bit_set.h" 7 #include "vm/bit_set.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/raw_object.h" 9 #include "vm/raw_object.h"
10 10
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 int total_size = 0; 155 int total_size = 0;
156 for (int i = 0; i < kNumLists; ++i) { 156 for (int i = 0; i < kNumLists; ++i) {
157 if (free_lists_[i] == NULL) { 157 if (free_lists_[i] == NULL) {
158 continue; 158 continue;
159 } 159 }
160 total_index += 1; 160 total_index += 1;
161 intptr_t length = Length(i); 161 intptr_t length = Length(i);
162 total_length += length; 162 total_length += length;
163 intptr_t size = length * i * kObjectAlignment; 163 intptr_t size = length * i * kObjectAlignment;
164 total_size += size; 164 total_size += size;
165 OS::Print("%*d %*d %*d\n", 10, i * kObjectAlignment, 10, length, 10, size); 165 OS::Print("%*d %*"Pd" %*"Pd"\n",
166 10, i * kObjectAlignment, 10, length, 10, size);
166 } 167 }
167 OS::Print("--------------------------------\n"); 168 OS::Print("--------------------------------\n");
168 OS::Print("%*d %*d %*d\n", 10, total_index, 10, total_length, 10, total_size); 169 OS::Print("%*d %*d %*d\n", 10, total_index, 10, total_length, 10, total_size);
169 } 170 }
170 171
171 172
172 void FreeList::SplitElementAfterAndEnqueue(FreeListElement* element, 173 void FreeList::SplitElementAfterAndEnqueue(FreeListElement* element,
173 intptr_t size) { 174 intptr_t size) {
174 intptr_t remainder_size = element->Size() - size; 175 intptr_t remainder_size = element->Size() - size;
175 if (remainder_size == 0) return; 176 if (remainder_size == 0) return;
176 177
177 element = FreeListElement::AsElement(reinterpret_cast<uword>(element) + size, 178 element = FreeListElement::AsElement(reinterpret_cast<uword>(element) + size,
178 remainder_size); 179 remainder_size);
179 intptr_t remainder_index = IndexForSize(remainder_size); 180 intptr_t remainder_index = IndexForSize(remainder_size);
180 EnqueueElement(element, remainder_index); 181 EnqueueElement(element, remainder_index);
181 } 182 }
182 183
183 } // namespace dart 184 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698