Browse Source

Do not duplicate variable name in this case.

This should save a lot of memory on many method calls.
release/v0.1
Rafal Kupiec 1 year ago
parent
commit
d09a33da55
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      engine/vm.c

+ 2
- 2
engine/vm.c View File

@ -4688,7 +4688,7 @@ static sxi32 VmByteCodeExec(
if(pThis && pVmFunc->iFlags & VM_FUNC_CLASS_METHOD) {
/* Install the '$parent' variable */
static const SyString sParent = { "parent", sizeof("parent") - 1 };
pObj = VmCreateMemObj(&(*pVm), &sParent, TRUE);
pObj = VmCreateMemObj(&(*pVm), &sParent, FALSE);
if(pObj) {
/* Reflect the change */
pObj->iFlags = MEMOBJ_PARENTOBJ;
@ -4697,7 +4697,7 @@ static sxi32 VmByteCodeExec(
}
/* Install the '$this' variable */
static const SyString sThis = { "this", sizeof("this") - 1 };
pObj = VmCreateMemObj(&(*pVm), &sThis, TRUE);
pObj = VmCreateMemObj(&(*pVm), &sThis, FALSE);
if(pObj) {
/* Reflect the change */
pObj->iFlags = MEMOBJ_THISOBJ;


Loading…
Cancel
Save