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

Unified Diff: unit_test/unit_test.h

Issue 2019753002: make unittest allocator align to 64 bytes. (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: remove commented code Created 4 years, 7 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 | « unit_test/planar_test.cc ('k') | unit_test/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unit_test/unit_test.h
diff --git a/unit_test/unit_test.h b/unit_test/unit_test.h
index 51e938df818bce3059c697fc06abc1c7ae7be5ae..f2c4bef00182a28bd5d4c9b34b6ce95f6d49be71 100644
--- a/unit_test/unit_test.h
+++ b/unit_test/unit_test.h
@@ -67,9 +67,9 @@ static inline bool SizeValid(int src_width, int src_height,
#define align_buffer_page_end(var, size) \
uint8* var; \
uint8* var##_mem; \
- var##_mem = reinterpret_cast<uint8*>(malloc((((size) + 4095) & ~4095) + \
- OFFBY)); \
- var = var##_mem + (-(size) & 4095) + OFFBY;
+ var##_mem = reinterpret_cast<uint8*>(malloc(((size) + 4095 + 63) & ~4095)); \
+ var = (uint8*)((intptr_t)(var##_mem + (((size) + 4095 + 63) & ~4095) - \
+ (size)) & ~63);
#define free_aligned_buffer_page_end(var) \
free(var##_mem); \
« no previous file with comments | « unit_test/planar_test.cc ('k') | unit_test/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698