#define UPDATE_DATA(ht, p, pData, nDataSize) \
if (nDataSize == sizeof(void*)) { \
- if (!(p)->pDataPtr) { \
- pefree_rel((p)->pData, (ht)->persistent); \
+ if ((p)->pData != &(p)->pDataPtr) { \
+ pefree_rel((p)->pData, (ht)->persistent); \
} \
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
(p)->pData = &(p)->pDataPtr; \
} else { \
- if ((p)->pDataPtr) { \
- (p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent); \
+ if ((p)->pData == &(p)->pDataPtr) { \
+ (p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent); \
(p)->pDataPtr=NULL; \
} else { \
(p)->pData = (void *) perealloc_rel((p)->pData, nDataSize, (ht)->persistent); \
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
(p)->pData = &(p)->pDataPtr; \
} else { \
- (p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent); \
+ (p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent);\
if (!(p)->pData) { \
- pefree_rel(p, (ht)->persistent); \
+ pefree_rel(p, (ht)->persistent); \
return FAILURE; \
} \
memcpy((p)->pData, pData, nDataSize); \
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
- if (!p->pDataPtr) {
+ if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
pefree(p, ht->persistent);
if (ht->pDestructor) {
ht->pDestructor(q->pData);
}
- if (!q->pDataPtr && q->pData) {
+ if (q->pData != &q->pDataPtr) {
pefree(q->pData, ht->persistent);
}
pefree(q, ht->persistent);
if (ht->pDestructor) {
ht->pDestructor(q->pData);
}
- if (!q->pDataPtr && q->pData) {
+ if (q->pData != &q->pDataPtr) {
pefree(q->pData, ht->persistent);
}
pefree(q, ht->persistent);
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
- if (!p->pDataPtr) {
+ if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
retval = p->pListNext;
q = p;
p = p->pListLast;
if (result & ZEND_HASH_APPLY_REMOVE) {
- if (q->nKeyLength>0) {
- zend_hash_del(ht, q->arKey, q->nKeyLength);
- } else {
- zend_hash_index_del(ht, q->h);
- }
+ zend_hash_apply_deleter(ht, q);
}
if (result & ZEND_HASH_APPLY_STOP) {
break;