Lines Matching refs:alignment
104 uint8_t *getAlignedMemory(uint8_t *orig_ptr, int alignment, int or_mask) { in getAlignedMemory() argument
107 if (alignment > 0) { in getAlignedMemory()
111 ptr += alignment - (ptr & (alignment - 1)); in getAlignedMemory()
112 ptr |= alignment | or_mask; in getAlignedMemory()
121 uint8_t *allocateAlignedMemory(size_t size, int alignment, int or_mask) { in allocateAlignedMemory() argument
122 uint64_t ptr = reinterpret_cast<uint64_t>(malloc(size + 3 * alignment)); in allocateAlignedMemory()
125 return getAlignedMemory((uint8_t*)ptr, alignment, or_mask); in allocateAlignedMemory()
165 int getAlignmentIncrement(size_t size, int alignment) { in getAlignmentIncrement() argument
166 if (alignment == 0) { in getAlignmentIncrement()
167 alignment = DEFAULT_MALLOC_MEMORY_ALIGNMENT; in getAlignmentIncrement()
169 alignment *= 2; in getAlignmentIncrement()
170 return size + alignment - (size % alignment); in getAlignmentIncrement()
173 uint8_t *getColdBuffer(int num_buffers, size_t incr, int alignment, int or_mask) { in getColdBuffer() argument
174 uint8_t *buffers = reinterpret_cast<uint8_t*>(malloc(num_buffers * incr + 3 * alignment)); in getColdBuffer()
178 return getAlignedMemory(buffers, alignment, or_mask); in getColdBuffer()