views:

249

answers:

0

Hi all,

I'm trying to memory-map and use a largish binary data file from my iPhone bundle resources. I've added the "Resources should be file-mapped" line with a checkmark to my Info.plist. Then I'm getting the data block like this (error handling and data release omitted):

CFBundleRef bun = CFBundleGetMainBundle();
CFURLRef url = CFBundleCopyResourceURL(bun, CFSTR(DBNAME), CFSTR("db"), 0); 
SInt32 ec;
CFDataRef Data;
CFURLCreateDataAndPropertiesFromResource(
    CFAllocatorGetDefault(), url, &Data, 0, 0, &ec);
char *pData = (char*)CFDataGetBytePtr(Data);

Does this really memory-map the file? While coding, I found many different ways to load a resource. The Apple docs are hand-waving about this - "just mark the bundle, it will map automatically". I have no way of verifying if it's indeed memory-mapped.

UPDATE: how can I verify that memory mapping takes place? Somewhere in the Instruments, maybe?