]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: add destructor to intrusive_lru 48128/head
authorAli Maredia <amaredia@redhat.com>
Thu, 15 Sep 2022 18:43:37 +0000 (14:43 -0400)
committerAli Maredia <amaredia@redhat.com>
Thu, 15 Sep 2022 20:20:36 +0000 (16:20 -0400)
commitabd84ad770ffe10771aeae060514a42e76150569
treed747f222b456882248a54f9f98fb418601ff9a5e
parentb3b28a4c42194ad93e57dd6ce26b53d319f8810d
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>
src/common/intrusive_lru.h