AnsweredAssumed Answered

Does the function "fread" have a upper-limit size for SHARC 21369?

Question asked by gggboy on Jan 26, 2010
Latest reply on Jan 29, 2010 by Mitesh

Hi,

 

I allocated a memory of N*32 bits in external memory successfully. When I tried to use "fread" function to read data from file on PC to the memory I allocated, I found it has a upper-limit size of 20*1024*32 bits.

 

If N is less than that size, it can read successfully. If N is more than that size, the function will jump to somewhere it was not supposed to.

 

So, does the function "fread" have a upper-limit size? How can I enlarge the upper-limit size?

 

 

code segment:

 

#define FILE_BUF_SIZE    1024*20

 

//allocate 4 memory segment.

    inPcmData_L_R = (int*)malloc(sizeof(int)*FILE_BUF_SIZE);
    inPcmData_SL_SR = (int*)malloc(sizeof(int)*FILE_BUF_SIZE);
    inPcmData_C_S = (int*)malloc(sizeof(int)*FILE_BUF_SIZE);
    inPcmData_SC = (int*)malloc(sizeof(int)*FILE_BUF_SIZE);
    outPcmData = (int*)malloc(sizeof(int)*FILE_BUF_SIZE);

 

//read 4 files to the allocated memory

static void InitPcmIO()
{
    pcmOut = fopen(outFileName,"wb");
    pcmIn_L_R = fopen(inFileName_L_R, "rb");
    pcmIn_SL_SR = fopen(inFileName_SL_SR, "rb");
    pcmIn_C_S = fopen(inFileName_C_S, "rb");
    pcmIn_SC = fopen(inFileName_SC, "rb");


}

Outcomes