-
Notifications
You must be signed in to change notification settings - Fork 14
Build Mmap.hh even if memory mapping is disabled #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
lmichaelis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heyo! I think it would be okay to expose the Mmap interface at all times, however this change is not enough to facilitate that.
We need to distinguish between "compiling with" and "using" memory mapping, so there need to be two different preprocessor defines. One which indicates whether memory-mapping support is available on the platform (which should be used instead of _ZK_WITH_MMAP in the Mmap.hh file) and one which indicates to the rest of ZenKit to actually use its memory-mapping capabilities (this needs to be a new preprocessor definition).
Because of this, it would probably be best to rebase this commit on the new mmap-free branch.
fec9ff3 to
7015057
Compare
Yeah makes sense, i havent looked at the branch much yet so for now i just implemented it hopefully properly. |
7015057 to
2203d7e
Compare
Build flag `ZK_ENABLE_MMAP` no longer excludes relevant header and implementation files from build -> Users of ZenKit can now use Mmap.hh by themselves even if `ZK_ENABLE_MMAP` is `OFF`
2203d7e to
3b1fb04
Compare
| endif () | ||
| else () | ||
| message(WARNING "ZenKit: Building WITHOUT memory mapping support") | ||
| message(STATUS "ZenKit: Memory mapping disabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also change this back to being warning if you want
Basically ZenKit is kind of a nice file input library with its Read interface and Mmap class.
So i want to have the option to use
Mmapfor my own file loading independent of ZenKit usage. So even if ZenKit is configured to not use mmap, i can still use it directly in my own code.Of course feel free to close if this does not fit very well, i can keep this change rebased on top of ZenKit branch myself if necessary.