Closed MambaWong closed 5 years ago
Hi @MambaWong, thank you for the PR! You're right, this was a silly oversight on my part. Thanks for fixing!
Is this making use of memory map wrong in some way?
@privefl Not any more, thankfully. But it was a serious bug in that if the caller specified an offset larger than the page size, the returned pointer would point to the wrong place... I guess I never really used the offset based approach and thus never noticed this, but I'm still baffled I let this slip in. Sorry!
I will add tests that test mapping at offsets that are larger than the system page size.
I think the virtual address maybe like this: ctx.data = mapping_start + offset - aligned_offset;