|
Specifying contiguous memory for static data
|
07/29/2008 11:50 AM
post11200
|
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
|
|
|