diff --git a/src/randomx.cpp b/src/randomx.cpp index 8f55b88..e4dda9a 100644 --- a/src/randomx.cpp +++ b/src/randomx.cpp @@ -183,6 +183,10 @@ extern "C" { return DatasetItemCount; } + unsigned long randomx_get_scratchpad_size() { + return randomx::ScratchpadSize; + } + void randomx_init_dataset(randomx_dataset *dataset, randomx_cache *cache, unsigned long startItem, unsigned long itemCount) { assert(dataset != nullptr); assert(cache != nullptr); diff --git a/src/randomx.h b/src/randomx.h index 313bcd2..7c5fd97 100644 --- a/src/randomx.h +++ b/src/randomx.h @@ -174,6 +174,13 @@ RANDOMX_EXPORT void *randomx_get_dataset_memory(randomx_dataset *dataset); */ RANDOMX_EXPORT void randomx_release_dataset(randomx_dataset *dataset); +/** + * Gets size of the scratchpad in bytes. + * + * @return the size of the scratchpad in bytes. +*/ +RANDOMX_EXPORT unsigned long randomx_get_scratchpad_size(void); + /** * Creates and initializes a RandomX virtual machine. *