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

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

Issue 23745008: Follow-up fix to my change to IsPowerOfTwo: Alignment of one means no alignment, not zero. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/native_arguments.h ('k') | runtime/vm/os_win.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 #ifndef VM_OS_H_ 5 #ifndef VM_OS_H_
6 #define VM_OS_H_ 6 #define VM_OS_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 9
10 // Forward declarations. 10 // Forward declarations.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return result; 53 return result;
54 } 54 }
55 55
56 // Returns an aligned pointer in the C heap with room for size bytes. 56 // Returns an aligned pointer in the C heap with room for size bytes.
57 // Alignment must be >= 16 and a power of two. 57 // Alignment must be >= 16 and a power of two.
58 static void* AlignedAllocate(intptr_t size, intptr_t alignment); 58 static void* AlignedAllocate(intptr_t size, intptr_t alignment);
59 59
60 // Frees a pointer returned from AlignedAllocate. 60 // Frees a pointer returned from AlignedAllocate.
61 static void AlignedFree(void* ptr); 61 static void AlignedFree(void* ptr);
62 62
63 // Returns the activation frame alignment constraint or zero if 63 // Returns the activation frame alignment constraint or one if
64 // the platform doesn't care. Guaranteed to be a power of two. 64 // the platform doesn't care. Guaranteed to be a power of two.
65 static word ActivationFrameAlignment(); 65 static word ActivationFrameAlignment();
66 66
67 // This constant is guaranteed to be greater or equal to the 67 // This constant is guaranteed to be greater or equal to the
68 // preferred code alignment on all platforms. 68 // preferred code alignment on all platforms.
69 static const int kMaxPreferredCodeAlignment = 32; 69 static const int kMaxPreferredCodeAlignment = 32;
70 70
71 // Returns the preferred code alignment or zero if 71 // Returns the preferred code alignment or zero if
72 // the platform doesn't care. Guaranteed to be a power of two. 72 // the platform doesn't care. Guaranteed to be a power of two.
73 static word PreferredCodeAlignment(); 73 static word PreferredCodeAlignment();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 static void Shutdown(); 131 static void Shutdown();
132 132
133 static void Abort(); 133 static void Abort();
134 134
135 static void Exit(int code); 135 static void Exit(int code);
136 }; 136 };
137 137
138 } // namespace dart 138 } // namespace dart
139 139
140 #endif // VM_OS_H_ 140 #endif // VM_OS_H_
OLDNEW
« no previous file with comments | « runtime/vm/native_arguments.h ('k') | runtime/vm/os_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698