|
@ -154,7 +154,7 @@ inline void dsacache::CacheData::WaitOnCompletion() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
dsacache::CacheData::CacheData(uint8_t* data, const size_t size) { |
|
|
|
|
|
|
|
|
inline dsacache::CacheData::CacheData(uint8_t* data, const size_t size) { |
|
|
std::cout << "[-] New CacheData 0x" << std::hex << (uint64_t)data << std::dec << std::endl; |
|
|
std::cout << "[-] New CacheData 0x" << std::hex << (uint64_t)data << std::dec << std::endl; |
|
|
|
|
|
|
|
|
src_ = data; |
|
|
src_ = data; |
|
@ -165,7 +165,7 @@ dsacache::CacheData::CacheData(uint8_t* data, const size_t size) { |
|
|
handlers_ = std::make_unique<std::vector<dml_handler>>(); |
|
|
handlers_ = std::make_unique<std::vector<dml_handler>>(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
dsacache::CacheData::CacheData(const dsacache::CacheData& other) { |
|
|
|
|
|
|
|
|
inline dsacache::CacheData::CacheData(const dsacache::CacheData& other) { |
|
|
std::cout << "[-] Copy Created for CacheData 0x" << std::hex << (uint64_t)other.src_ << std::dec << std::endl; |
|
|
std::cout << "[-] Copy Created for CacheData 0x" << std::hex << (uint64_t)other.src_ << std::dec << std::endl; |
|
|
|
|
|
|
|
|
// we copy the ptr to the global atomic reference counter
|
|
|
// we copy the ptr to the global atomic reference counter
|
|
@ -190,7 +190,7 @@ dsacache::CacheData::CacheData(const dsacache::CacheData& other) { |
|
|
handlers_ = nullptr; |
|
|
handlers_ = nullptr; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
dsacache::CacheData::~CacheData() { |
|
|
|
|
|
|
|
|
inline dsacache::CacheData::~CacheData() { |
|
|
std::cout << "[-] Destructor for CacheData 0x" << std::hex << (uint64_t)src_ << std::dec << std::endl; |
|
|
std::cout << "[-] Destructor for CacheData 0x" << std::hex << (uint64_t)src_ << std::dec << std::endl; |
|
|
|
|
|
|
|
|
// if this is the first instance of this cache structure
|
|
|
// if this is the first instance of this cache structure
|
|
@ -221,7 +221,7 @@ dsacache::CacheData::~CacheData() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void dsacache::CacheData::Deallocate() { |
|
|
|
|
|
|
|
|
inline void dsacache::CacheData::Deallocate() { |
|
|
std::cout << "[!] Deallocating for CacheData 0x" << std::hex << (uint64_t)src_ << std::dec << std::endl; |
|
|
std::cout << "[!] Deallocating for CacheData 0x" << std::hex << (uint64_t)src_ << std::dec << std::endl; |
|
|
|
|
|
|
|
|
// although deallocate should only be called from
|
|
|
// although deallocate should only be called from
|
|
@ -232,11 +232,11 @@ void dsacache::CacheData::Deallocate() { |
|
|
if (cache_local != nullptr) numa_free(cache_local, size_); |
|
|
if (cache_local != nullptr) numa_free(cache_local, size_); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint8_t* dsacache::CacheData::GetDataLocation() const { |
|
|
|
|
|
|
|
|
inline uint8_t* dsacache::CacheData::GetDataLocation() const { |
|
|
return cache_->load(); |
|
|
return cache_->load(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool dsacache::CacheData::Active() const { |
|
|
|
|
|
|
|
|
inline bool dsacache::CacheData::Active() const { |
|
|
// this entry is active if more than one
|
|
|
// this entry is active if more than one
|
|
|
// reference exists to it, as the Cache
|
|
|
// reference exists to it, as the Cache
|
|
|
// will always keep one internally until
|
|
|
// will always keep one internally until
|
|
|