diff options
author | mtklein <mtklein@chromium.org> | 2014-08-28 14:10:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-28 14:10:05 -0700 |
commit | 0209e95cc2625a445c1cb6c4213d2182e5c832d7 (patch) | |
tree | 08c2a5c26bddb05543628e7509a75d00490c1558 /src | |
parent | 23b406cc040d55b45acc96e63db5c2d5c934a53c (diff) |
Align all SkRecord::alloc() calls up to at least a pointer size.
This should make the LSAN bots able to see all our pointers.
BUG=skia:
R=reed@google.com, robertphillips@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/517073002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkRecord.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkRecord.h b/src/core/SkRecord.h index 96da69b12e..203a16c4e8 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. |