This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Reset a BUF pool

I was looking for something like a BUF_reset API which resets the pool to it's initial state (all buffers freed up), but didn't find any.

Why is that? Is there another way to achieve this?

 

 

  • There is no specific API call to do what you are describing.  Typically, an application wants to be careful about matching up calls to BUF_alloc() with calls to BUF_free() to make sure they stay 1:1.  Of course, you could always call BUF_delete() to blow everything away, but that would be a bit more expensive to execute.