Coverage Report

Created: 2025-07-23 06:45

/src/sleuthkit/tsk/img/legacy_cache.cpp
Line
Count
Source (jump to first uncovered line)
1
#include "legacy_cache.h"
2
3
#include <cstring>
4
5
LegacyCache::LegacyCache():
6
27.9k
  cache{},
7
27.9k
  cache_off{},
8
27.9k
  cache_age{},
9
27.9k
  cache_len{}
10
27.9k
{
11
27.9k
  tsk_init_lock(&cache_lock);
12
27.9k
}
13
14
27.9k
LegacyCache::~LegacyCache() {
15
27.9k
  tsk_deinit_lock(&cache_lock);
16
27.9k
}
17
18
13.5M
void LegacyCache::lock() {
19
13.5M
  tsk_take_lock(&cache_lock);
20
13.5M
}
21
22
13.5M
void LegacyCache::unlock() {
23
13.5M
  tsk_release_lock(&cache_lock);
24
13.5M
}
25
26
0
void LegacyCache::clear() {
27
  // Setting the lengths to zero should invalidate the cache.
28
0
  std::memset(cache_len, 0, sizeof(cache_len));
29
0
}