-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SDL_MemoryMapFile implementation #10960
base: main
Are you sure you want to change the base?
Conversation
I would expect something that maps subrange of the file, like as I said in the proposal thread, having a writable mapping can also sometimes be useful. To support this the interface could reasonably take a subset of the same file opening options that the iostreams do for consistency's sake (the only one that doesn't really make sense here is append, although it could be reused to mean "allocate" here - as in performing the equivalent of fallocate before the mmap if the requested mapping passes the end of the existing file) |
Can we implement memory mapping on top of @kieselsteini |
return true; | ||
} | ||
|
||
void *SDL_GetMemoryMappedData(const SDL_MemoryMappedFile *mmfile, size_t *datasize) { |
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.
SDL_SYS_GetMemoryMappedData
?
This PR will introduce the new
SDL_MemoryMapFile
API to provide a simple cross-platform way, to create read only file mappings in memory.Description
In order to make it work on all platforms we have to introduce a platform specific struct called
SDL_MemoryMappedFile
which holds platform specific details for the file mapping.Existing Issue(s)
SDL_UnmapMemoryFile