Lines Matching defs:alignment
34 // Ok reference on memory alignment:
35 // http://stackoverflow.com/questions/227897/solve-the-memory-alignment-in-c-interview-question-that-stumped-me
48 void* AlignedMalloc(size_t size, size_t alignment)
50 if(alignment == 0)
52 // Don't allow alignment 0 since it's undefined.
55 // Make sure that the alignment is an integer power of two or fail.
56 if(alignment & (alignment - 1))
68 // alignment - 1 bytes needs to be allocated.
72 alignment - 1);
84 // The buffer should be aligned with 'alignment' bytes. The - 1 guarantees
86 uintptr_t alignedPos = (alignStartPos + alignment - 1) & ~(alignment - 1);