Add afterProgramPage() for filesystem support

This commit is contained in:
Michal Moskal 2016-11-07 16:04:15 +00:00
parent cf982d7c52
commit b4b789422e

View File

@ -203,6 +203,19 @@ namespace pxt {
void *ptrOfLiteral(int offset);
//%
int getNumGlobals();
//%
uint32_t programSize() {
return bytecode[17] * 2;
}
//%
uint32_t afterProgramPage() {
uint32_t ptr = (uint32_t)&bytecode[0];
ptr += programSize();
ptr = (ptr + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
return ptr;
}
}
namespace pxtrt {