graphitemaster / incbin

Include binary files in C/C++
The Unlicense
938 stars 87 forks source link

Memory consumption #35

Closed alexandregomes-acceptto closed 4 years ago

alexandregomes-acceptto commented 4 years ago

Hi, quick question, is the data loaded into memory at launch?

I'm looking for a solution that allows me to embed a couple very large (GB-scale) zip files, and would allow me to "mmap" into that section of the memory, without having to load the entire binary's data at load, any suggestions?

graphitemaster commented 4 years ago

You can use a custom binary section like mentioned in the README which the default program loader won't load. Then it's up to you to read /proc/self/exe, parse the ELF header in the running binary to find the section and mmap it by hand.