mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-08-15 00:23:14 +00:00
Function typedefs without pointer
This commit is contained in:
parent
7f6bdd9a52
commit
cf72ed79c7
3 changed files with 14 additions and 14 deletions
|
@ -113,11 +113,11 @@ namespace randomx {
|
||||||
fpu_reg_t a[RegistersCount / 2];
|
fpu_reg_t a[RegistersCount / 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void(*DatasetReadFunc)(addr_t, MemoryRegisters&, int_reg_t(®)[RegistersCount]);
|
typedef void(DatasetReadFunc)(addr_t, MemoryRegisters&, int_reg_t(®)[RegistersCount]);
|
||||||
typedef void(*ProgramFunc)(RegisterFile&, MemoryRegisters&, uint8_t* /* scratchpad */, uint64_t);
|
typedef void(ProgramFunc)(RegisterFile&, MemoryRegisters&, uint8_t* /* scratchpad */, uint64_t);
|
||||||
typedef void(*DatasetInitFunc)(randomx_cache* cache, uint8_t* dataset, uint32_t startBlock, uint32_t endBlock);
|
typedef void(DatasetInitFunc)(randomx_cache* cache, uint8_t* dataset, uint32_t startBlock, uint32_t endBlock);
|
||||||
|
|
||||||
typedef void(*DatasetDeallocFunc)(randomx_dataset*);
|
typedef void(DatasetDeallocFunc)(randomx_dataset*);
|
||||||
typedef void(*CacheDeallocFunc)(randomx_cache*);
|
typedef void(CacheDeallocFunc)(randomx_cache*);
|
||||||
typedef void(*CacheInitializeFunc)(randomx_cache*, const void*, size_t);
|
typedef void(CacheInitializeFunc)(randomx_cache*, const void*, size_t);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ along with RandomX. If not, see<http://www.gnu.org/licenses/>.
|
||||||
/* Global scope for C binding */
|
/* Global scope for C binding */
|
||||||
struct randomx_dataset {
|
struct randomx_dataset {
|
||||||
uint8_t* memory = nullptr;
|
uint8_t* memory = nullptr;
|
||||||
randomx::DatasetDeallocFunc dealloc;
|
randomx::DatasetDeallocFunc* dealloc;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace randomx {
|
namespace randomx {
|
||||||
|
@ -39,10 +39,10 @@ namespace randomx {
|
||||||
/* Global scope for C binding */
|
/* Global scope for C binding */
|
||||||
struct randomx_cache {
|
struct randomx_cache {
|
||||||
uint8_t* memory = nullptr;
|
uint8_t* memory = nullptr;
|
||||||
randomx::CacheDeallocFunc dealloc;
|
randomx::CacheDeallocFunc* dealloc;
|
||||||
randomx::JitCompilerX86* jit;
|
randomx::JitCompilerX86* jit;
|
||||||
randomx::CacheInitializeFunc initialize;
|
randomx::CacheInitializeFunc* initialize;
|
||||||
randomx::DatasetInitFunc datasetInit;
|
randomx::DatasetInitFunc* datasetInit;
|
||||||
randomx::SuperscalarProgram programs[RANDOMX_CACHE_ACCESSES];
|
randomx::SuperscalarProgram programs[RANDOMX_CACHE_ACCESSES];
|
||||||
std::vector<uint64_t> reciprocalCache;
|
std::vector<uint64_t> reciprocalCache;
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,11 +45,11 @@ namespace randomx {
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
void generateSuperscalarHash(SuperscalarProgram (&programs)[N], std::vector<uint64_t> &);
|
void generateSuperscalarHash(SuperscalarProgram (&programs)[N], std::vector<uint64_t> &);
|
||||||
void generateDatasetInitCode();
|
void generateDatasetInitCode();
|
||||||
ProgramFunc getProgramFunc() {
|
ProgramFunc* getProgramFunc() {
|
||||||
return (ProgramFunc)code;
|
return (ProgramFunc*)code;
|
||||||
}
|
}
|
||||||
DatasetInitFunc getDatasetInitFunc() {
|
DatasetInitFunc* getDatasetInitFunc() {
|
||||||
return (DatasetInitFunc)code;
|
return (DatasetInitFunc*)code;
|
||||||
}
|
}
|
||||||
uint8_t* getCode() {
|
uint8_t* getCode() {
|
||||||
return code;
|
return code;
|
||||||
|
|
Loading…
Reference in a new issue