Using Memcpy to set/fetch opcodes to avoid issues with CPUs that don't support misalignment

This commit is contained in:
L 2023-02-02 23:48:51 +01:00
parent 1b1de99e53
commit 456c886c48
4 changed files with 966 additions and 665 deletions

View file

@ -167,6 +167,22 @@ public:
void Optimize( unsigned char *progBuffer );
static str GetLine( str content, int line );
private:
template<typename Value>
void EmitOpcodeValue(const Value& value, size_t size);
template<typename Value>
void EmitAt(unsigned char* location, const Value& value, size_t size);
template<typename Value>
void SetOpcodeValue(const Value& value);
template<typename Value>
Value GetOpcodeValue(size_t size) const;
template<typename Value>
Value GetOpcodeValue(size_t offset, size_t size) const;
};
extern ScriptCompiler Compiler;