Skip to content
Snippets Groups Projects
Commit ea3621ab authored by James Zern's avatar James Zern Committed by Gerrit Code Review
Browse files

Merge "aom_mem,align_addr: use ~ to create mask" into nextgenv2

parents fe24b956 20b85983
No related branches found
No related tags found
2 merge requests!6Rav1e 11 yushin 1,!3Rav1e 10 yushin
......@@ -42,7 +42,7 @@ void *aom_memalign(size_t align, size_t size) {
const size_t aligned_size = GetAlignedMallocSize(size, align);
void *const addr = malloc(aligned_size);
if (addr) {
x = align_addr((unsigned char *)addr + ADDRESS_STORAGE_SIZE, (int)align);
x = align_addr((unsigned char *)addr + ADDRESS_STORAGE_SIZE, align);
SetActualMallocAddress(x, addr);
}
return x;
......
......@@ -27,6 +27,6 @@
/*returns an addr aligned to the byte boundary specified by align*/
#define align_addr(addr, align) \
(void *)(((size_t)(addr) + ((align)-1)) & (size_t) - (align))
(void *)(((size_t)(addr) + ((align)-1)) & ~(size_t)((align)-1))
#endif // AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment