Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/randomx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ extern "C" {
}
}

void *randomx_get_cache_memory(randomx_cache *cache) {
assert(cache != nullptr);
return cache->memory;
}

void randomx_release_cache(randomx_cache* cache) {
assert(cache != nullptr);
cache->dealloc(cache);
Expand Down
10 changes: 10 additions & 0 deletions src/randomx.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ RANDOMX_EXPORT randomx_cache *randomx_alloc_cache(randomx_flags flags);
*/
RANDOMX_EXPORT void randomx_init_cache(randomx_cache *cache, const void *key, size_t keySize);

/**
* Returns a pointer to the internal memory buffer of the cache structure. The size
* of the internal memory buffer is RANDOMX_ARGON_MEMORY KiB.
*
* @param cache is a pointer to a previously allocated randomx_cache structure. Must not be NULL.
*
* @return Pointer to the internal memory buffer of the cache structure.
*/
RANDOMX_EXPORT void *randomx_get_cache_memory(randomx_cache *cache);

/**
* Releases all memory occupied by the randomx_cache structure.
*
Expand Down
Loading