> I know, of course, stack meaning, though, this is not such a problem, I
> think. We can easily increase stack size with project settings -> target ->
> PPC target -> stack size (default 64K) in CW.
>
> I wrote following test code, but could not compile. The line,
>
> char chunk[64*1024L];
>
> is smaller than 128*1024L, and there may be enough remnant of stack,
> however, CW tells me "local data is larger than 32K". I do think, locak data
> is not equal to stack. Local data may mean local variables in specific
> funcion.
>
> How can I break though this limit? I ask this in general macintosh
> programming mailing list, people says, "There is no way. Make it global or
> static."
>
> Do I misunderstand?
>
No. You can not effectively store local data of more than 2^15 bytes :). I
think this is because the addresses for local data are relative(to save
space,i believe) and are stored on 16 bits while global variables have
absolute addresses on 32 bits .You can have details in "Introduction to
PowerPC system software" available at ftp.apple.com page 1-21 and following
about the code Fragment manager: the code is divided in fragments with a
TOC(table of contents) for each fragment where the TOC contains a global
value and offsets of 16 bits to represent local pointers.If you write a big,
big routine(more than 32767 bytes when compiled), you may have problems too.
If you don't want chunk to be global, you must allocate it dynamically :
void foo(void)
{
char *chunk;
chunk = calloc(64,1024L); // full of zeros
�
free(chunk);
}
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )