corda/sgx-jvm/avian/src/bootimage-template.cpp
Andras Slemmer 9bb3d6b972 Add 'sgx-jvm/avian/' from commit '09e4fe60d01f4f4bfb6b2976973bb4913ef61edc'
git-subtree-dir: sgx-jvm/avian
git-subtree-mainline: f978eab8d1
git-subtree-split: 09e4fe60d0
2017-03-13 12:18:24 +00:00

27 lines
745 B
C++

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