aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/map.c
diff options
context:
space:
mode:
authorStanley Cheung <stanley.cheung@gmail.com>2016-10-04 13:39:51 -0700
committerBo Yang <teboring@google.com>2016-10-10 11:44:54 -0700
commit1e5d4ba9387362ece026e78148f4ac5881537e64 (patch)
treeadf8537822e5e4982c0358bb218bf7992aceeb01 /php/ext/google/protobuf/map.c
parentc96dd669a9da2b2c44c9c54313c61ee06791aa79 (diff)
downloadprotobuf-1e5d4ba9387362ece026e78148f4ac5881537e64.tar.gz
protobuf-1e5d4ba9387362ece026e78148f4ac5881537e64.tar.bz2
protobuf-1e5d4ba9387362ece026e78148f4ac5881537e64.zip
PHP: fix ZTS tsrm_ls errors (#2189)
* PHP: fix ZTS tsrm_ls errors * Fix a few more macros
Diffstat (limited to 'php/ext/google/protobuf/map.c')
-rw-r--r--php/ext/google/protobuf/map.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c
index 6d822fff..6a80d978 100644
--- a/php/ext/google/protobuf/map.c
+++ b/php/ext/google/protobuf/map.c
@@ -88,7 +88,7 @@ void* upb_value_memory(upb_value* v) {
static bool table_key(Map* self, zval* key,
char* buf,
const char** out_key,
- size_t* out_length) {
+ size_t* out_length TSRMLS_DC) {
switch (self->key_type) {
case UPB_TYPE_STRING:
if (!protobuf_convert_to_string(key)) {
@@ -108,7 +108,7 @@ static bool table_key(Map* self, zval* key,
if (!protobuf_convert_to_##type(key, &type##_value)) { \
return false; \
} \
- native_slot_set(self->key_type, NULL, buf, key); \
+ native_slot_set(self->key_type, NULL, buf, key TSRMLS_CC); \
*out_key = buf; \
*out_length = native_slot_size(self->key_type); \
break; \
@@ -248,7 +248,7 @@ void map_field_create_with_type(zend_class_entry *ce, const upb_fielddef *field,
const upb_fielddef *value_field = map_field_value(field);
intern->key_type = upb_fielddef_type(key_field);
intern->value_type = upb_fielddef_type(value_field);
- intern->msg_ce = field_type_class(value_field);
+ intern->msg_ce = field_type_class(value_field TSRMLS_CC);
}
static void map_field_free_element(void *object) {
@@ -270,7 +270,7 @@ static bool *map_field_read_dimension(zval *object, zval *key, int type,
#ifndef NDEBUG
v.ctype = UPB_CTYPE_UINT64;
#endif
- if (!table_key(intern, key, keybuf, &keyval, &length)) {
+ if (!table_key(intern, key, keybuf, &keyval, &length TSRMLS_CC)) {
return false;
}
@@ -303,13 +303,14 @@ static bool map_field_write_dimension(zval *object, zval *key,
size_t length = 0;
upb_value v;
void* mem;
- if (!table_key(intern, key, keybuf, &keyval, &length)) {
+ if (!table_key(intern, key, keybuf, &keyval, &length TSRMLS_CC)) {
return false;
}
mem = upb_value_memory(&v);
memset(mem, 0, native_slot_size(intern->value_type));
- if(!native_slot_set(intern->value_type, intern->msg_ce, mem, value)) {
+ if (!native_slot_set(intern->value_type, intern->msg_ce, mem, value
+ TSRMLS_CC)) {
return false;
}
#ifndef NDEBUG
@@ -333,7 +334,7 @@ static bool map_field_unset_dimension(zval *object, zval *key TSRMLS_DC) {
const char* keyval = NULL;
size_t length = 0;
upb_value v;
- if (!table_key(intern, key, keybuf, &keyval, &length)) {
+ if (!table_key(intern, key, keybuf, &keyval, &length TSRMLS_CC)) {
return false;
}
#ifndef NDEBUG
@@ -396,7 +397,7 @@ PHP_METHOD(MapField, offsetExists) {
#ifndef NDEBUG
v.ctype = UPB_CTYPE_UINT64;
#endif
- if (!table_key(intern, key, keybuf, &keyval, &length)) {
+ if (!table_key(intern, key, keybuf, &keyval, &length TSRMLS_CC)) {
return false;
}
@@ -446,7 +447,7 @@ PHP_METHOD(MapField, count) {
// Map Iterator
// -----------------------------------------------------------------------------
-void map_begin(zval *map_php, MapIter *iter) {
+void map_begin(zval *map_php, MapIter *iter TSRMLS_DC) {
Map *self = UNBOX(Map, map_php);
map_begin_internal(self, iter);
}