Mario Charest
|
Re: Specifying contiguous memory for static data
|
Mario Charest
07/29/2008 4:24 PM
post11205
|
Re: 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?
>
I'm not from QNX. I don't think that's possible. Couldn't you load the data from an external file.
>
> Thanks!
>
> Jim
|
|
|