Free Buffers

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 544
Joined: Mon May 12, 2008 10:55 am

Free Buffers

Post by SeeCwriter » Fri May 27, 2022 11:00 am

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?

User avatar
pbreed
Posts: 1044
Joined: Thu Apr 24, 2008 3:58 pm

Re: Free Buffers

Post by pbreed » Fri May 27, 2022 1:20 pm

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..

SeeCwriter
Posts: 544
Joined: Mon May 12, 2008 10:55 am

Re: Free Buffers

Post by SeeCwriter » Fri May 27, 2022 1:45 pm

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?

User avatar
pbreed
Posts: 1044
Joined: Thu Apr 24, 2008 3:58 pm

Re: Free Buffers

Post by pbreed » Sun May 29, 2022 12:20 pm

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.

User avatar
pbreed
Posts: 1044
Joined: Thu Apr 24, 2008 3:58 pm

Re: Free Buffers

Post by pbreed » Sun May 29, 2022 12:21 pm

Record the number of free buffers as the very first thing you do in UserMain and thats a good number to use for 100%.

Post Reply