Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Specifying contiguous memory for static data: Page 1 of 8 (8 Items)
   
Specifying contiguous memory for static data  
I'm developing a application that requires contiguous memory for statically initialized byte arrays.  The arrays are 
declared similar to:

const unsigned char bit_data[BIT_DATA_SIZE] __attribute__((aligned(64))) = 
{
    ##, ##, ##, ….
};

I obtain a physical memory address for this data to use with the embedded hardware using the mem_offset() function.  The
 returned physical address is correct but the data is not contiguous in physical memory.

Allocating a contiguous block using mmap() and copying the data doubles up the RAM utilization which is not desired 
(since i cannot "free" the original static array).  The static arrays are auto-generated and contain uncompressed image 
data.  The size of the static array can be very large (over a megabyte).

Is there any way to force the static data to be contiguous in the application?

Thanks!

Jim