[MemoryBuffer] Allow optionally specifying desired buffer alignment
Underlying data may have requirements/expectations/etc. about the run-time alignment. WritableMemoryBuffer currently uses a 16 byte alignment, which works for many situations but not all. Allowing a desired alignment makes it easier to reuse WritableMemoryBuffer in situations of special alignment, and also removes a problem when opening files with special alignment constraints. Large files generally get mmaped, which has ~page alignment, but small files go through WritableMemoryBuffer which has the much smaller alignment guarantee. Differential Revision: https://reviews.llvm.org/D137820
Loading
Please sign in to comment