]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: add destructor to intrusive_lru 54557/head
authorAli Maredia <amaredia@redhat.com>
Thu, 15 Sep 2022 18:43:37 +0000 (14:43 -0400)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 18 Nov 2023 20:02:17 +0000 (03:02 +0700)
commit56731116e0eb7736f8fda38c2c75695c13f9869d
treea89ee35493a08ae137c49702e780d850a4c58187
parent792285b8a64a28b28cf37027fbc3d9447472607d
common: add destructor to intrusive_lru

values created during inserts that are
unreferenced are not deleted because evict()
does not delete values unless set.size() > lru_target_size.

For example, this condition is not met if the number
of entries in the intrusive_lru are less than or
equal to lru_target_size at the time of the
intrusive_lru's destruction.

Memory leaks due to the above scenario can be
reproduced if this commit is removed and
unittest_intrusive_lru is run under valgrind.

ex:

valgrind --tool=memcheck --leak-check=yes ./bin/unittest_intrusive_lru

Signed-off-by: Ali Maredia <amaredia@redhat.com>
(cherry picked from commit abd84ad770ffe10771aeae060514a42e76150569)
src/common/intrusive_lru.h