Could be related to #27
I believe the following line was wrong:
let aligned_size = offset + size - aligned_offset;
Given that size is aligned, aligned_offset is aligned, but offset is not necessarily aligned, we get a situation where aligned_size is not aligned. Moreover, it's less than the required size for mapping, which can lead to EXC_BAD_ACCESS upon writing to it.
Could be related to #27 I believe the following line was wrong:
Given that
size
is aligned,aligned_offset
is aligned, butoffset
is not necessarily aligned, we get a situation wherealigned_size
is not aligned. Moreover, it's less than the required size for mapping, which can lead toEXC_BAD_ACCESS
upon writing to it.