On 2021-10-13 11:32, Nick wrote:
> Does it make a difference in terms of performance to use stack buffers?
> I switched now to using stack buffers, since for me it makes the code
> more readable not having to deal with several buffers and possible race
> conditions. (but just my view on the
Does it make a difference in terms of performance to use stack buffers?
I switched now to using stack buffers, since for me it makes the code
more readable not having to deal with several buffers and possible race
conditions. (but just my view on the topic)
Thanks a lot for your answer. I
On 2021-10-13 07:53, Nick wrote:
> Since I saw there were some new patches, e.g., procd, fixing
> blob_buf_free() calls.
> I asked several months ago: "Should you call blob_buf_free() after
> calling blob_buf_init()?"
>
As rule of thumb I would say:
- use struct blob_buf b = {0}; in the function as local variable
- free after using it
- use "struct ubus_context *ctx_local" in callback functions to
differentiate between global ctx pointer and local callback variables
In the examples it is also freed. However,
Since I saw there were some new patches, e.g., procd, fixing
blob_buf_free() calls.
I asked several months ago: "Should you call blob_buf_free() after
calling blob_buf_init()?"
https://forum.openwrt.org/t/should-you-call-blob-buf-free-after-calling-blob-buf-init
I did not receive any answer. I