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

Unified Diff: src/allocation.h

Issue 22849002: Rewrite SamplingCircularQueue (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Deleted circular-queue.cc Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/circular-queue.h » ('j') | src/circular-queue.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/allocation.h
diff --git a/src/allocation.h b/src/allocation.h
index 45bde4c4cb07068a05e301d2124990637d82609d..09344f9187482b120bf6f5c44f1f717ad872513c 100644
--- a/src/allocation.h
+++ b/src/allocation.h
@@ -30,6 +30,19 @@
#include "globals.h"
+/* Round up n to be a multiple of sz, where sz is a power of 2. */
+#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
+
+// Specify memory alignment for structs, classes, etc.
+// Use like:
+// class ALIGN_AT(16) MyClass { ... }
+// ALIGNAS(16) int array[4];
Benedikt Meurer 2013/08/13 14:29:42 Typo: ALIGN_AT
yurys 2013/08/13 14:52:37 Done.
+#if defined(_MSC_VER)
+#define ALIGN_AT(byte_alignment) __declspec(align(byte_alignment))
+#elif defined(__GNUC__)
+#define ALIGN_AT(byte_alignment) __attribute__((aligned(byte_alignment)))
+#endif
Benedikt Meurer 2013/08/13 14:29:42 Missing #else for other compilers.
yurys 2013/08/13 14:52:37 Done. Added #error for other compilers.
+
namespace v8 {
namespace internal {
« no previous file with comments | « no previous file | src/circular-queue.h » ('j') | src/circular-queue.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698