Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7191671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:46:43+00:00 2026-05-28T19:46:43+00:00

I’m trying to embed binary media resources into source code. I will going to

  • 0

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

  1. it’s part of code
  2. 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 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:46:45+00:00Added an answer on May 28, 2026 at 7:46 pm

    I don’t fully understand what you are saying or trying to solve, but it sounds like you are looking for memory mapping. See man mmap.

    ps reading again, if I understand your question correctly, you want to make a fat binary containing all resource data. In that case, the OS will probably page out unused parts of it, so the memory is “freed” automatically. (“freed” in the sense of releasing physical memory that can be used for other purposes) So the persistant binary will remain in virtual memory, but not in physical memory.

    update to explain a little further

    On your Mac, in the terminal, run

    $ vmmap -resident $$
    

    This will show the virtual memory mapping for your shell, showing total memory and resident memory. You will see this line:

    ==== Non-writable regions for process 7139
    __TEXT 0100000000-00100099000 [  612K   460K] r-x/rwx SM=COW  /bin/bash
    

    This says, that in this region of memory the file /bin/bash is to be found (memory mapped, again, see man mmap) and that it is not fully paged in; only 460kb of the binary is actually present in memory. Which is interesting because this is the binary actually running. The other lines are interesting as well, but beyond the scope of this question.

    so if the OS of choice (iOS) has sane memory management, your problem does not really exist. Just don’t touch memory you don’t need to use; every time you touch it, the pages are read in memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.