[SDL] [OT] Resource file
Andre de Leiradella
leiradella at bigfoot.com
Thu Feb 21 05:43:49 PST 2008
>> 1. Is there any thing bad about mmapping a resource file? The file size
>> can easily be greater than 4 GiB.
> Pages that are mmapped from the file can't be used for other memory.
> Therefore, on most 32-bit platforms, an app using a resource file
> that's near 2GiB would have serious memory starvation problems. If you
> selectively mmap only relevant portions instead, that's not a problem,
> I think; and mmap generally provides a significant performance
> improvement in situations like this.
But only pages actually accessed by the application are actually brought
to RAM by the OS, right? Moreover, the OS will swap out pages to disk if
the application needs physical RAM, won't it?
>> 4. Do you have requirements for a new resource file?
> I probably won't use this (none of my current projects require
> anything like it), but were I to need it, portability would be a
> primary concern. I live on a distressing variety of CPU architectures
> and operating systems, and too often is a nice-looking library ruined
> because it won't work on all of them. (ONE of my computers is x86.)
I can test only on Linux (x86 and PPC) and Windows, and I'll make sure
it works on those platforms.
Thanks for the input, I'll do more research regarding mmapping files.
More information about the SDL