File tree Expand file tree Collapse file tree 1 file changed +0
-14
lines changed
Expand file tree Collapse file tree 1 file changed +0
-14
lines changed Original file line number Diff line number Diff line change 1616#include " ../jit_compiler.hpp"
1717#include " ../aes_hash.hpp"
1818
19- struct CacheKey {
20- void * key;
21- size_t size = 0 ;
22- };
23-
2419randomx_cache* cache;
2520randomx_vm* vm = nullptr ;
26- CacheKey currentKey;
2721
2822template <size_t N>
2923void initCache (const char (&key)[N]) {
3024 assert (cache != nullptr );
31- if (N - 1 == currentKey.size && memcmp (currentKey.key , key, N - 1 ) == 0 )
32- return ;
33- // std::cout << "randomx_init_cache with key ";
34- // outputHex(std::cout, key, N - 1);
35- // std::cout << std::endl;
3625 randomx_init_cache (cache, key, N - 1 );
37- currentKey.key = (void *)key;
38- currentKey.size = N - 1 ;
3926 if (vm != nullptr )
4027 randomx_vm_set_cache (vm, cache);
4128}
@@ -1011,7 +998,6 @@ int main() {
1011998 if (RANDOMX_HAVE_COMPILER) {
1012999 randomx_release_cache (cache);
10131000 cache = randomx_alloc_cache (RANDOMX_FLAG_JIT);
1014- currentKey.size = 0 ;
10151001 randomx_destroy_vm (vm);
10161002 initCache (" test key 000" );
10171003 vm = randomx_create_vm (RANDOMX_FLAG_JIT, cache, nullptr );
You can’t perform that action at this time.
0 commit comments