Page MenuHomePhabricator

windows: Fix file mapping
AbandonedPublic

Authored by walac on Jun 23 2020, 1:22 PM.

Details

Reviewers
vtorri
Summary

On Windows, the file map offset must be a multiple of the system
allocation granularity.

We handle the alignment requirement internally. We round down the given
offset to the next aligned value. We then map the aligned offset plus
the offset difference plus the map length. We adjust the returned
pointer value to the original offset and store the original pointer
inside the file map structure for use by the unmap function.

Test Plan

meson test eina

Diff Detail

Repository
rEFL core/efl
Branch
eina-patches
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17066
Build 11344: arc lint + arc unit
walac created this revision.Jun 23 2020, 1:22 PM
walac requested review of this revision.Jun 23 2020, 1:22 PM
stefan_schmidt added inline comments.
src/lib/eina/eina_file_common.h
119

Adding this in the middle of the struct really breaks binary compat here. I know that we do not really care about that in Windows, but could we not just add it ad the end of the struct to extend its size?

walac updated this revision to Diff 30766.Jun 24 2020, 6:06 AM

Fix struct layout compatibility

walac marked an inline comment as done.Jun 24 2020, 6:07 AM
jptiz added a comment.Jun 26 2020, 7:03 AM

Since D12031 has landed, I think this one can be closed.

walac abandoned this revision.Jun 26 2020, 7:31 AM