Lines Matching refs:alignment
29 char* GetAlignedMemory(char* orig_ptr, size_t alignment, size_t or_mask) { in GetAlignedMemory() argument
30 if ((alignment & (alignment - 1)) != 0) { in GetAlignedMemory()
33 if (or_mask > alignment) { in GetAlignedMemory()
37 if (alignment > 0) { in GetAlignedMemory()
41 ptr += alignment - (ptr & (alignment - 1)); in GetAlignedMemory()
42 ptr |= alignment | or_mask; in GetAlignedMemory()
48 char* GetAlignedPtr(std::vector<char>* buf, size_t alignment, size_t nbytes) { in GetAlignedPtr() argument
49 buf->resize(nbytes + 3 * alignment); in GetAlignedPtr()
50 return GetAlignedMemory(buf->data(), alignment, 0); in GetAlignedPtr()
53 wchar_t* GetAlignedPtr(std::vector<wchar_t>* buf, size_t alignment, size_t nchars) { in GetAlignedPtr() argument
54 buf->resize(nchars + ceil((3 * alignment) / sizeof(wchar_t))); in GetAlignedPtr()
56 alignment, 0)); in GetAlignedPtr()
59 char* GetAlignedPtrFilled(std::vector<char>* buf, size_t alignment, size_t nbytes, char fill_byte) { in GetAlignedPtrFilled() argument
60 char* buf_aligned = GetAlignedPtr(buf, alignment, nbytes); in GetAlignedPtrFilled()