mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-25 12:06:04 +00:00
Fixed code allocation for ARM
This commit is contained in:
parent
0e70974d7d
commit
e74573f81f
1 changed files with 9 additions and 14 deletions
|
@ -108,6 +108,7 @@ JitCompilerA64::JitCompilerA64(bool hugePagesEnable, bool) :
|
||||||
hugePages(hugePagesJIT && hugePagesEnable),
|
hugePages(hugePagesJIT && hugePagesEnable),
|
||||||
literalPos(ImulRcpLiteralsEnd)
|
literalPos(ImulRcpLiteralsEnd)
|
||||||
{
|
{
|
||||||
|
allocate(CodeSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
JitCompilerA64::~JitCompilerA64()
|
JitCompilerA64::~JitCompilerA64()
|
||||||
|
@ -117,13 +118,8 @@ JitCompilerA64::~JitCompilerA64()
|
||||||
|
|
||||||
void JitCompilerA64::generateProgram(Program& program, ProgramConfiguration& config, uint32_t)
|
void JitCompilerA64::generateProgram(Program& program, ProgramConfiguration& config, uint32_t)
|
||||||
{
|
{
|
||||||
if (!allocatedSize) {
|
|
||||||
allocate(CodeSize);
|
|
||||||
}
|
|
||||||
#ifdef XMRIG_SECURE_JIT
|
#ifdef XMRIG_SECURE_JIT
|
||||||
else {
|
enableWriting();
|
||||||
enableWriting();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t codePos = MainLoopBegin + 4;
|
uint32_t codePos = MainLoopBegin + 4;
|
||||||
|
@ -177,13 +173,8 @@ void JitCompilerA64::generateProgram(Program& program, ProgramConfiguration& con
|
||||||
|
|
||||||
void JitCompilerA64::generateProgramLight(Program& program, ProgramConfiguration& config, uint32_t datasetOffset)
|
void JitCompilerA64::generateProgramLight(Program& program, ProgramConfiguration& config, uint32_t datasetOffset)
|
||||||
{
|
{
|
||||||
if (!allocatedSize) {
|
|
||||||
allocate(CodeSize);
|
|
||||||
}
|
|
||||||
#ifdef XMRIG_SECURE_JIT
|
#ifdef XMRIG_SECURE_JIT
|
||||||
else {
|
enableWriting();
|
||||||
enableWriting();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t codePos = MainLoopBegin + 4;
|
uint32_t codePos = MainLoopBegin + 4;
|
||||||
|
@ -244,8 +235,12 @@ void JitCompilerA64::generateProgramLight(Program& program, ProgramConfiguration
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
void JitCompilerA64::generateSuperscalarHash(SuperscalarProgram(&programs)[N])
|
void JitCompilerA64::generateSuperscalarHash(SuperscalarProgram(&programs)[N])
|
||||||
{
|
{
|
||||||
if (!allocatedSize) {
|
const size_t requiredSize = CodeSize + CalcDatasetItemSize();
|
||||||
allocate(CodeSize + CalcDatasetItemSize());
|
if (allocatedSize < requiredSize) {
|
||||||
|
if (allocatedSize) {
|
||||||
|
freePagedMemory(code, allocatedSize);
|
||||||
|
}
|
||||||
|
allocate(requiredSize);
|
||||||
}
|
}
|
||||||
#ifdef XMRIG_SECURE_JIT
|
#ifdef XMRIG_SECURE_JIT
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue