Page 1 of 1

Free Buffers

Posted: Fri May 27, 2022 11:00 am
by SeeCwriter
I'm using v3.3.7 on a NANO.

Using function GetFreeCount() to get the number of free system buffers, I get a value of 266. If I am following the code correctly, the buffer pool, declared in buffers.cpp (line 85), is created with 256 buffers. Am I looking in the wrong place?

Re: Free Buffers

Posted: Fri May 27, 2022 1:20 pm
by pbreed
System allocates any extra SRAM availible to SRAM pool buffers, so 2546 in SDRAM and whatever space is left in SRAM.
SRAM buffers are much faster..

Re: Free Buffers

Posted: Fri May 27, 2022 1:45 pm
by SeeCwriter
I'm not following. I was just trying to determine the percentage of system buffers used, as was suggested. If 266 is the number of free buffers, what is the total number of buffers?

Re: Free Buffers

Posted: Sun May 29, 2022 12:20 pm
by pbreed
There is no fixed number.
It uses ALL the unused SRAM for additional buffers...
So depending on what your program allocates in SRAM (will vary by what code is linked and some flag options)
it will vary.

The 256 allocated in SDRAM is a fixed number.

Re: Free Buffers

Posted: Sun May 29, 2022 12:21 pm
by pbreed
Record the number of free buffers as the very first thing you do in UserMain and thats a good number to use for 100%.