On Tuesday, July 20th, 2021 at 9:09 PM, <otr...@employees.org> wrote:
> Yes. Thanks for spotting this. > Would you mind submitting a patch? Will be happy to offer a patch. I can think of 3 ways to fix this: 1. Call `stat_segment_data_free()` to free the memory in the vppapiclient library code itself in the case of epoch change. From what I understand, this will internally call vector_resize. Will that turn out to be costly? In effect we are calling `vector_resize` two times one for allocation and another for freeing almost at the same time. 2. Another approach is, instead of freeing that memory at that moment just 'mark it for deletion' and then delete this at a later stage from the calling function/process. 3. Update the structure `stat_segment_data_t` (res) with an additional flag `ignore`. If epoch changes, update this flag to 'true', but return res instead of 0. The calling function can ignore the data, but can free the memory. Which one would be the best way forward? X.
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#19839): https://lists.fd.io/g/vpp-dev/message/19839 Mute This Topic: https://lists.fd.io/mt/84335081/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-