I'm trying to embed binary media resources into source code. I will going to use plain C-array (char[]
) to store binary. (with something like this: Embedding binary blobs using gcc mingw) Because managing media files resource separately is very annoying work because the symbol it is hard to determined at compile time, and makes my customers annoying too.
Anyway what I'm concerning is memory consuming. If I store a PNG image, actually, I don't need the persistent binary anymore after I loaded live image instance (UIImage*
) from it. But I think the persistent binary will remain in memory because
- it's part of code
- and it's constant.
I don't know any option to remove it from memory.
How can I let a C-array always to be accessed from disk directly instead of remaining in memory?
PS. I can limit my build and execution environment strictly. I will use Clang and the program will be run on iOS. Anyway I don't mind to use any of extra build tool :)