corda/sgx-jvm/avian/src/bootimage-template.cpp

27 lines
745 B
C++
Raw Normal View History

const unsigned NAME(BootMask) = (~static_cast<unsigned>(0))
2014-07-11 15:50:18 +00:00
/ NAME(BytesPerWord);
const unsigned NAME(BootShift) UNUSED = 32 - avian::util::log(NAME(BytesPerWord));
2014-07-11 15:50:18 +00:00
inline unsigned LABEL(codeMapSize)(unsigned codeSize)
{
2014-07-11 15:50:18 +00:00
return avian::util::ceilingDivide(codeSize, TargetBitsPerWord)
* TargetBytesPerWord;
}
2014-07-11 15:50:18 +00:00
inline unsigned LABEL(heapMapSize)(unsigned heapSize)
{
2014-07-11 15:50:18 +00:00
return avian::util::ceilingDivide(heapSize,
TargetBitsPerWord * TargetBytesPerWord)
* TargetBytesPerWord;
}
2014-07-11 15:50:18 +00:00
inline object LABEL(bootObject)(LABEL(uintptr_t) * heap, unsigned offset)
{
if (offset) {
return reinterpret_cast<object>(heap + offset - 1);
} else {
return 0;
}
}