Browse Source

Simply release the object, no need to use a wrapper function.

pull/50/head
Rafal Kupiec 3 years ago
parent
commit
59e2743a60
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
  1. 8
      engine/hashmap.c
  2. 11
      engine/memobj.c
  3. 1
      include/ph7int.h

8
engine/hashmap.c

@ -546,8 +546,8 @@ static sxi32 HashmapInsert(
if(pVal) {
PH7_MemObjStore(pVal, pElem);
} else {
/* Nullify the entry */
PH7_MemObjToNull(pElem);
/* Release the entry */
PH7_MemObjRelease(pElem);
}
}
return SXRET_OK;
@ -570,8 +570,8 @@ IntKey:
if(pVal) {
PH7_MemObjStore(pVal, pElem);
} else {
/* Nullify the entry */
PH7_MemObjToNull(pElem);
/* Release the entry */
PH7_MemObjRelease(pElem);
}
}
return SXRET_OK;

11
engine/memobj.c

@ -468,13 +468,6 @@ PH7_PRIVATE sxi32 PH7_MemObjToString(ph7_value *pObj) {
}
return rc;
}
/*
* Nullify a ph7_value.In other words invalidate any prior
* representation.
*/
PH7_PRIVATE sxi32 PH7_MemObjToNull(ph7_value *pObj) {
return PH7_MemObjRelease(pObj);
}
/*
* Convert a ph7_value to type array.Invalidate any prior representations.
* According to the PHP language reference manual.
@ -602,8 +595,8 @@ PH7_PRIVATE ProcMemObjCast PH7_MemObjCastMethod(sxi32 iFlags) {
} else if(iFlags & MEMOBJ_VOID) {
return PH7_MemObjToVoid;
}
/* NULL cast */
return PH7_MemObjToNull;
/* Release the variable */
return PH7_MemObjRelease;
}
/*
* Check whether the ph7_value is numeric [i.e: int/float/bool] or looks

1
include/ph7int.h

@ -1651,7 +1651,6 @@ PH7_PRIVATE sxi32 PH7_MemObjIsEmpty(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToHashmap(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToObject(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToString(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToNull(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToReal(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToInteger(ph7_value *pObj);
PH7_PRIVATE sxi32 PH7_MemObjToBool(ph7_value *pObj);

Loading…
Cancel
Save