Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
b1386e77
Unverified
Commit
b1386e77
authored
Dec 11, 2017
by
Paul Yang
Committed by
GitHub
Dec 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4026 from TeBoring/3.5.x
Merge 3.5.0.1 to 3.5.x
parents
cf7c15e3
fc5818b2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
7 deletions
+66
-7
def.c
php/ext/google/protobuf/def.c
+2
-0
message.c
php/ext/google/protobuf/message.c
+4
-0
package.xml
php/ext/google/protobuf/package.xml
+35
-3
protobuf.h
php/ext/google/protobuf/protobuf.h
+1
-1
type_check.c
php/ext/google/protobuf/type_check.c
+1
-0
memory_leak_test.php
php/tests/memory_leak_test.php
+23
-3
No files found.
php/ext/google/protobuf/def.c
View file @
b1386e77
...
...
@@ -249,9 +249,11 @@ PHP_METHOD(Descriptor, getField) {
MAKE_STD_ZVAL
(
field_hashtable_value
);
ZVAL_OBJ
(
field_hashtable_value
,
field_descriptor_type
->
create_object
(
field_descriptor_type
TSRMLS_CC
));
Z_DELREF_P
(
field_hashtable_value
);
#else
field_hashtable_value
=
field_descriptor_type
->
create_object
(
field_descriptor_type
TSRMLS_CC
);
--
GC_REFCOUNT
(
field_hashtable_value
);
#endif
FieldDescriptor
*
field_php
=
UNBOX_HASHTABLE_VALUE
(
FieldDescriptor
,
field_hashtable_value
);
...
...
php/ext/google/protobuf/message.c
View file @
b1386e77
...
...
@@ -379,6 +379,7 @@ PHP_METHOD(Message, whichOneof) {
PHP_PROTO_FAKE_SCOPE_BEGIN(LOWER_CLASS##_type); \
zval* value = message_get_property_internal(getThis(), &member TSRMLS_CC); \
PHP_PROTO_FAKE_SCOPE_END; \
zval_dtor(&member); \
PHP_PROTO_RETVAL_ZVAL(value); \
} \
PHP_METHOD(UPPER_CLASS, set##UPPER_FIELD) { \
...
...
@@ -390,6 +391,7 @@ PHP_METHOD(Message, whichOneof) {
zval member; \
PHP_PROTO_ZVAL_STRING(&member, LOWER_FIELD, 1); \
message_set_property_internal(getThis(), &member, value TSRMLS_CC); \
zval_dtor(&member); \
PHP_PROTO_RETVAL_ZVAL(getThis()); \
}
...
...
@@ -402,6 +404,7 @@ PHP_METHOD(Message, whichOneof) {
message_get_oneof_property_internal(getThis(), &member, \
return_value TSRMLS_CC); \
PHP_PROTO_FAKE_SCOPE_END; \
zval_dtor(&member); \
} \
PHP_METHOD(UPPER_CLASS, set##UPPER_FIELD) { \
zval* value = NULL; \
...
...
@@ -412,6 +415,7 @@ PHP_METHOD(Message, whichOneof) {
zval member; \
PHP_PROTO_ZVAL_STRING(&member, LOWER_FIELD, 1); \
message_set_property_internal(getThis(), &member, value TSRMLS_CC); \
zval_dtor(&member); \
PHP_PROTO_RETVAL_ZVAL(getThis()); \
}
...
...
php/ext/google/protobuf/package.xml
View file @
b1386e77
...
...
@@ -10,11 +10,11 @@
<email>
protobuf-opensource@google.com
</email>
<active>
yes
</active>
</lead>
<date>
2017-1
1-15
</date>
<date>
2017-1
2-11
</date>
<time>
11:02:07
</time>
<version>
<release>
3.5.
0
</release>
<api>
3.5.
0
</api>
<release>
3.5.
1
</release>
<api>
3.5.
1
</api>
</version>
<stability>
<release>
stable
</release>
...
...
@@ -181,6 +181,38 @@ GA release.
<time>
11:02:07
</time>
<license
uri=
"https://opensource.org/licenses/BSD-3-Clause"
>
3-Clause BSD License
</license>
<notes>
GA release.
</notes>
</release>
<release>
<version>
<release>
3.5.0.1
</release>
<api>
3.5.0.1
</api>
</version>
<stability>
<release>
stable
</release>
<api>
stable
</api>
</stability>
<date>
2017-12-06
</date>
<time>
11:02:07
</time>
<license
uri=
"https://opensource.org/licenses/BSD-3-Clause"
>
3-Clause BSD License
</license>
<notes>
GA release.
</notes>
</release>
<release>
<version>
<release>
3.5.1
</release>
<api>
3.5.1
</api>
</version>
<stability>
<release>
stable
</release>
<api>
stable
</api>
</stability>
<date>
2017-12-11
</date>
<time>
11:02:07
</time>
<license
uri=
"https://opensource.org/licenses/BSD-3-Clause"
>
3-Clause BSD License
</license>
<notes>
GA release.
</notes>
</release>
...
...
php/ext/google/protobuf/protobuf.h
View file @
b1386e77
...
...
@@ -37,7 +37,7 @@
#include "upb.h"
#define PHP_PROTOBUF_EXTNAME "protobuf"
#define PHP_PROTOBUF_VERSION "3.5.
0
"
#define PHP_PROTOBUF_VERSION "3.5.
1
"
#define MAX_LENGTH_OF_INT64 20
#define SIZEOF_INT64 8
...
...
php/ext/google/protobuf/type_check.c
View file @
b1386e77
...
...
@@ -532,6 +532,7 @@ void check_map_field(const zend_class_entry* klass, PHP_PROTO_LONG key_type,
map_field_handlers
->
write_dimension
(
CACHED_TO_ZVAL_PTR
(
map_field
),
&
key
,
CACHED_PTR_TO_ZVAL_PTR
((
CACHED_VALUE
*
)
value
)
TSRMLS_CC
);
zval_dtor
(
&
key
);
}
RETURN_ZVAL
(
CACHED_TO_ZVAL_PTR
(
map_field
),
1
,
1
);
...
...
php/tests/memory_leak_test.php
View file @
b1386e77
...
...
@@ -50,7 +50,8 @@ $to->mergeFromString($data);
TestUtil
::
assertTestMessage
(
$to
);
$from
->
setRecursive
(
$from
);
// TODO(teboring): This causes following tests fail in php7.
# $from->setRecursive($from);
$arr
=
new
RepeatedField
(
GPBType
::
MESSAGE
,
TestMessage
::
class
);
$arr
[]
=
new
TestMessage
;
...
...
@@ -106,15 +107,34 @@ $m->mergeFromString(hex2bin('F80601'));
assert
(
'F80601'
,
bin2hex
(
$m
->
serializeToString
()));
// Test create repeated field via array.
$str_arr
=
array
();
$str_arr
=
array
(
"abc"
);
$m
=
new
TestMessage
();
$m
->
setRepeatedString
(
$str_arr
);
// Test create map field via array.
$str_arr
=
array
();
$str_arr
=
array
(
"abc"
=>
"abc"
);
$m
=
new
TestMessage
();
$m
->
setMapStringString
(
$str_arr
);
// Test unset
$from
=
new
TestMessage
();
TestUtil
::
setTestMessage
(
$from
);
unset
(
$from
);
// Test wellknown
$from
=
new
\Google\Protobuf\Timestamp
();
$from
->
setSeconds
(
1
);
assert
(
1
,
$from
->
getSeconds
());
$from
=
new
\Google\Protobuf\Value
();
$from
->
setNumberValue
(
1
);
assert
(
1
,
$from
->
getNumberValue
());
// Test descriptor
$pool
=
\Google\Protobuf\DescriptorPool
::
getGeneratedPool
();
$desc
=
$pool
->
getDescriptorByClassName
(
"\Foo\TestMessage"
);
$field
=
$desc
->
getField
(
1
);
# $from = new TestMessage();
# $to = new TestMessage();
# TestUtil::setTestMessage($from);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment