This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory model vs. memory allocation.

Suppose I have declared in my C code that the memory model is LARGE, then when initialize the memory pool and allocate memory segment, should I specify the location of the memory segment?

In other words, in the following two C code fragments, which one is correct?

 #pragma LARGE
 ...
 unsigned char xdata *p;
 init_mempool (&XBYTE [0x2000], 0x400);
 p = (unsigned char xdata *) malloc (1000);

v.s.

 #pragma LARGE
 ...
 unsigned char *p;
 init_mempool (0x2000, 1024);
 p = (unsigned char *) malloc (1000);

many thanks,
Kan