@@ -23,7 +23,7 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
23
23
#include <stddef.h>
24
24
25
25
#define RANDOMX_HASH_SIZE 32
26
- #define RANDOMX_DATASET_ITEMS 33554432UL
26
+ #define RANDOMX_DATASET_ITEM_SIZE 64
27
27
28
28
typedef enum {
29
29
RANDOMX_FLAG_DEFAULT = 0 ,
@@ -82,10 +82,17 @@ void randomx_release_cache(randomx_cache* cache);
82
82
*/
83
83
randomx_dataset * randomx_alloc_dataset (randomx_flags flags );
84
84
85
+ /**
86
+ * Gets the number of items contained in the dataset.
87
+ *
88
+ * @return the number of items contained in the dataset.
89
+ */
90
+ unsigned long randomx_dataset_item_count ();
91
+
85
92
/**
86
93
* Initializes dataset items.
87
94
*
88
- * Note: In order to use the Dataset, all items from 0 to (RANDOMX_DATASET_ITEMS - 1) must be initialized.
95
+ * Note: In order to use the Dataset, all items from 0 to (randomx_dataset_item_count() - 1) must be initialized.
89
96
* This may be done by several calls to this function using non-overlapping item sequences.
90
97
*
91
98
* @param dataset is a pointer to a previously allocated randomx_dataset structure. Must not be NULL.
@@ -95,6 +102,16 @@ randomx_dataset *randomx_alloc_dataset(randomx_flags flags);
95
102
*/
96
103
void randomx_init_dataset (randomx_dataset * dataset , randomx_cache * cache , unsigned long startItem , unsigned long itemCount );
97
104
105
+ /**
106
+ * Returns a pointer to the internal memory buffer of the dataset structure. The size
107
+ * of the internal memory buffer is randomx_dataset_item_count() * RANDOMX_DATASET_ITEM_SIZE.
108
+ *
109
+ * @param dataset is dataset is a pointer to a previously allocated randomx_dataset structure. Must not be NULL.
110
+ *
111
+ * @return Pointer to the internal memory buffer of the dataset structure.
112
+ */
113
+ void * randomx_get_dataset_memory (randomx_dataset * dataset );
114
+
98
115
/**
99
116
* Releases all memory occupied by the randomx_dataset structure.
100
117
*
0 commit comments