Buffer size
scottyg
Posts: 2
What is the maximum buffer size in NetLinx?
0
What is the maximum buffer size in NetLinx?
Comments
Can't put my finger an an exact max value but I have code reading in large files where I implemented 100k strings
The largest I have working is a local var cTmpBuf[262140]. Local so it can concatenate incoming strings through multiple data events. Just like with some large structures I can't view in debug because it will crash NS4.
if you're going to use a local_var for a big buffer like that allocate it out of volatile...
Believe me, trying to track down why the processor crashed because it ran out of non volatile memory can be a time consuming exercise.
Hmmm, I don’t think I’ve ever designated a local var as volatile. Maybe I always assumed they were that way naturally whereas globals were only assignable and non volatile by default. I can’t think of anywhere at least in my code where a local needs to be non volatile but I guess since I’ve never designated them volatile they are. .
stack_var is allocated out of volatile.
local_var is allocated out of non-volatile by default.
I can personally testify that if you have a common file reading function that allocates 100k local_var buffers and that file is referenced by a dozen or so modules and that when all those modules call that read function simultaneously the master will immediately reboot...