Index: src/core/SkRecord.h |
diff --git a/src/core/SkRecord.h b/src/core/SkRecord.h |
index 96da69b12ef8c150729c07c8e846fab5452cb1dc..203a16c4e872768fbf47f5204f5ebf82e83dc7b7 100644 |
--- a/src/core/SkRecord.h |
+++ b/src/core/SkRecord.h |
@@ -65,7 +65,8 @@ public: |
// Here T can be any class, not just those from SkRecords. Throws on failure. |
template <typename T> |
T* alloc(size_t count = 1) { |
- return (T*)fAlloc.allocThrow(sizeof(T) * count); |
+ // Bump up to the next pointer width if needed, so all allocations start pointer-aligned. |
+ return (T*)fAlloc.allocThrow(SkAlignPtr(sizeof(T) * count)); |
} |
// Add a new command of type T to the end of this SkRecord. |