/* Filename-seen cache for the GNU debugger, GDB.
- Copyright (C) 1986-2019 Free Software Foundation, Inc.
+ Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
-/* Local non-gdb includes. */
#include "filename-seen-cache.h"
#include "filenames.h"
/* filename_seen_cache constructor. */
filename_seen_cache::filename_seen_cache ()
+ : m_tab (htab_create_alloc (INITIAL_FILENAME_SEEN_CACHE_SIZE,
+ filename_hash, filename_eq,
+ NULL, xcalloc, xfree))
{
- m_tab = htab_create_alloc (INITIAL_FILENAME_SEEN_CACHE_SIZE,
- filename_hash, filename_eq,
- NULL, xcalloc, xfree);
}
/* See filename-seen-cache.h. */
void
filename_seen_cache::clear ()
{
- htab_empty (m_tab);
-}
-
-/* See filename-seen-cache.h. */
-
-filename_seen_cache::~filename_seen_cache ()
-{
- htab_delete (m_tab);
+ htab_empty (m_tab.get ());
}
/* See filename-seen-cache.h. */
void **slot;
/* Is FILE in tab? */
- slot = htab_find_slot (m_tab, file, INSERT);
+ slot = htab_find_slot (m_tab.get (), file, INSERT);
if (*slot != NULL)
return true;