Skip to content
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

Support mmap-ing dynamic data on win32 #20

Open
ghost opened this issue Jul 27, 2015 · 5 comments
Open

Support mmap-ing dynamic data on win32 #20

ghost opened this issue Jul 27, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Jul 27, 2015

Originally reported on Google Code with ID 20

As described in issue 19, the current implementation of dynamic data won't work in windows
because it relies on:
 * from sys/mman.h: mmap(), munmap()
 * from unistd.h: close()

These header files don't exist in vanilla win32 build environments, so compatibility
is broken. The fix for close() is being implemented in issue 19, but the fix for mmap()
is less straightforward.

Reported by [email protected] on 2014-08-13 11:40:10

@ghost
Copy link
Author

ghost commented Jul 27, 2015

For now, the answer is going to be that loading/unloading from a file is not going to
work. Instead, Windows support will have to be limited to the "raw" modes:

Instead of CLD2::loadDataFromFile, use CLD2::loadDataFromRawAddress. It is up to the
caller to figure out how to get that raw pointer to point to the correct thing, presumably
using CreateFileMapping and associate functions.

Internally, these methods will be disabled for win32:
CLD2DynamicDataLoader::loadDataFile
CLD2DynamicDataLoader::unloadDataFile

Instead, use these if needed:
CLD2DynamicDataLoader::loadDataRaw
CLD2DynamicDataLoader::unloadDataRaw

Reported by [email protected] on 2014-08-13 12:00:05

@ghost
Copy link
Author

ghost commented Jul 27, 2015

We should really also have an MSVC project file for building CLD2 on Windows. Contributions
welcome, as I have no experience with MSVC.

Reported by [email protected] on 2014-08-13 12:09:42

@ghost
Copy link
Author

ghost commented Jul 27, 2015

Windows support for data file disabled in r166. Use raw modes instead, as described
above. This should keep windows compilers happy.

Reported by [email protected] on 2014-08-13 12:38:07

@ghost
Copy link
Author

ghost commented Jul 27, 2015

Clarifying subject, since raw mode SHOULD work on Windows. It's only file mode that
is disabled.

Reported by [email protected] on 2014-08-13 12:50:30

@ghost
Copy link
Author

ghost commented Jul 27, 2015

Reported by [email protected] on 2014-10-27 20:44:37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
and others