- Allocate VM script code and constants in a single block for better locality of
reference. SVN r1924 (scripting)
This commit is contained in:
parent
e209a2f208
commit
7ea11cd169
5 changed files with 81 additions and 51 deletions
|
|
@ -94,9 +94,9 @@ void FState::SetAction(PSymbolActionFunction *func, bool setdefaultparams)
|
|||
|
||||
// Create a function for this state.
|
||||
VMScriptFunction *vmfunc = new VMScriptFunction;
|
||||
VMOP *code = vmfunc->AllocCode(sizeof(codetemplate)/sizeof(VMOP));
|
||||
memcpy(code, codetemplate, sizeof(codetemplate));
|
||||
FVoidObj *konsta = vmfunc->AllocKonstA(2);
|
||||
vmfunc->Alloc(sizeof(codetemplate)/sizeof(VMOP), 0, 0, 0, 2);
|
||||
memcpy(vmfunc->Code, codetemplate, sizeof(codetemplate));
|
||||
FVoidObj *konsta = vmfunc->KonstA;
|
||||
VM_ATAG *atag = vmfunc->KonstATags();
|
||||
konsta[0].v = (void *)func->Function;
|
||||
konsta[1].o = callfunc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue