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

Side by Side Diff: runtime/vm/zone.h

Issue 1331623002: Uses SNPRINT macro where possible. Otherwise uses #define for format. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add missing include Created 5 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
« no previous file with comments | « runtime/vm/version_in.cc ('k') | runtime/vm/zone.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_ZONE_H_ 5 #ifndef VM_ZONE_H_
6 #define VM_ZONE_H_ 6 #define VM_ZONE_H_
7 7
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/handles.h" 10 #include "vm/handles.h"
(...skipping 28 matching lines...) Expand all
39 // 39 //
40 // It is preferred to use Alloc<T>() instead, as that function can 40 // It is preferred to use Alloc<T>() instead, as that function can
41 // check for integer overflow. If you use AllocUnsafe, you are 41 // check for integer overflow. If you use AllocUnsafe, you are
42 // responsible for avoiding integer overflow yourself. 42 // responsible for avoiding integer overflow yourself.
43 inline uword AllocUnsafe(intptr_t size); 43 inline uword AllocUnsafe(intptr_t size);
44 44
45 45
46 // Make a copy of the string in the zone allocated area. 46 // Make a copy of the string in the zone allocated area.
47 char* MakeCopyOfString(const char* str); 47 char* MakeCopyOfString(const char* str);
48 48
49 // TODO(zra): Remove these calls and replace them with calls to OS::SCreate
50 // and OS::VSCreate.
51 // These calls are deprecated. Do not add further calls to these functions.
52 // instead use OS::SCreate and OS::VSCreate.
49 // Make a zone-allocated string based on printf format and args. 53 // Make a zone-allocated string based on printf format and args.
50 char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); 54 char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
51
52 char* VPrint(const char* format, va_list args); 55 char* VPrint(const char* format, va_list args);
53 56
54 // Compute the total size of this zone. This includes wasted space that is 57 // Compute the total size of this zone. This includes wasted space that is
55 // due to internal fragmentation in the segments. 58 // due to internal fragmentation in the segments.
56 intptr_t SizeInBytes() const; 59 intptr_t SizeInBytes() const;
57 60
58 // Structure for managing handles allocation. 61 // Structure for managing handles allocation.
59 VMHandles* handles() { return &handles_; } 62 VMHandles* handles() { return &handles_; }
60 63
61 void VisitObjectPointers(ObjectPointerVisitor* visitor); 64 void VisitObjectPointers(ObjectPointerVisitor* visitor);
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 memmove(reinterpret_cast<void*>(new_data), 286 memmove(reinterpret_cast<void*>(new_data),
284 reinterpret_cast<void*>(old_data), 287 reinterpret_cast<void*>(old_data),
285 old_len * kElementSize); 288 old_len * kElementSize);
286 } 289 }
287 return new_data; 290 return new_data;
288 } 291 }
289 292
290 } // namespace dart 293 } // namespace dart
291 294
292 #endif // VM_ZONE_H_ 295 #endif // VM_ZONE_H_
OLDNEW
« no previous file with comments | « runtime/vm/version_in.cc ('k') | runtime/vm/zone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698