| #include "../Common/Memory.hpp" |
| #include "../Common/Thread.hpp" |
| #include "../Common/Types.hpp" |
| Routine::Routine(int bufferSize) : bufferSize(bufferSize), dynamic(true) |
| void *memory = allocateExecutable(bufferSize); |
| functionSize = bufferSize; // Updated by RoutineManager::endFunctionBody |
| Routine::Routine(void *memory, int bufferSize, int offset) : bufferSize(bufferSize), functionSize(bufferSize), dynamic(false) |
| buffer = (unsigned char*)memory - offset; |
| deallocateExecutable(buffer, bufferSize); |
| void Routine::setFunctionSize(int functionSize) |
| this->functionSize = functionSize; |
| const void *Routine::getBuffer() |
| const void *Routine::getEntry() |
| int Routine::getBufferSize() |
| int Routine::getFunctionSize() |
| int Routine::getCodeSize() |
| return functionSize - ((uintptr_t)entry - (uintptr_t)buffer); |
| bool Routine::isDynamic() |
| atomicIncrement(&bindCount); |
| long count = atomicDecrement(&bindCount); |