Initial commit

This commit is contained in:
ktkk 2025-10-15 11:30:58 +00:00
commit ef40bd03c5
14 changed files with 276 additions and 0 deletions

26
include/Executable.h Executable file
View file

@ -0,0 +1,26 @@
#include <cstddef>
#include "Types.h"
#include "Noncopyable.h"
class Executable {
MAKE_NONCOPYABLE(Executable);
MAKE_NONMOVABLE(Executable);
public:
Executable(void* code, std::size_t code_size);
~Executable();
template<typename Return>
Return run() const
{
using ExecutableFunction = Return();
auto executable_function = reinterpret_cast<ExecutableFunction*>(m_code);
return executable_function();
}
private:
void* m_code;
std::size_t m_code_size;
};