aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/protobuf.c
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-07-25 00:49:16 -0700
committerGitHub <noreply@github.com>2017-07-25 00:49:16 -0700
commit451d061141a14021ff95a093967827cd548720ba (patch)
tree84c032c0e1ffd34b6a8b97cc342ede6c0f257f9f /php/ext/google/protobuf/protobuf.c
parenta713b73076f1d90bdc39ea8805b50421a59d7986 (diff)
downloadprotobuf-451d061141a14021ff95a093967827cd548720ba.tar.gz
protobuf-451d061141a14021ff95a093967827cd548720ba.tar.bz2
protobuf-451d061141a14021ff95a093967827cd548720ba.zip
Fix cycle dependency for repeated field not collected by gc (#3399)
Diffstat (limited to 'php/ext/google/protobuf/protobuf.c')
-rw-r--r--php/ext/google/protobuf/protobuf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/php/ext/google/protobuf/protobuf.c b/php/ext/google/protobuf/protobuf.c
index 5de9cfe9..2b5b58c6 100644
--- a/php/ext/google/protobuf/protobuf.c
+++ b/php/ext/google/protobuf/protobuf.c
@@ -55,13 +55,13 @@ static void add_to_table(HashTable* t, const void* def, void* value) {
uint nIndex = (ulong)def & t->nTableMask;
zval* pDest = NULL;
- php_proto_zend_hash_index_update(t, (zend_ulong)def, &value, sizeof(zval*),
- (void**)&pDest);
+ php_proto_zend_hash_index_update_mem(t, (zend_ulong)def, &value,
+ sizeof(zval*), (void**)&pDest);
}
static void* get_from_table(const HashTable* t, const void* def) {
void** value;
- if (php_proto_zend_hash_index_find(t, (zend_ulong)def, (void**)&value) ==
+ if (php_proto_zend_hash_index_find_mem(t, (zend_ulong)def, (void**)&value) ==
FAILURE) {
zend_error(E_ERROR, "PHP object not found for given definition.\n");
return NULL;
@@ -71,13 +71,13 @@ static void* get_from_table(const HashTable* t, const void* def) {
static bool exist_in_table(const HashTable* t, const void* def) {
void** value;
- return (php_proto_zend_hash_index_find(t, (zend_ulong)def, (void**)&value) ==
- SUCCESS);
+ return (php_proto_zend_hash_index_find_mem(t, (zend_ulong)def,
+ (void**)&value) == SUCCESS);
}
static void add_to_list(HashTable* t, void* value) {
zval* pDest = NULL;
- php_proto_zend_hash_next_index_insert(t, &value, sizeof(void*),
+ php_proto_zend_hash_next_index_insert_mem(t, &value, sizeof(void*),
(void**)&pDest);
}