0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 14:01:53 +00:00

TODO Fixme for v8js_v8object_get_gc()

This commit is contained in:
Jan-E 2018-07-05 09:21:36 +02:00
parent 79fffb6418
commit d7af84b7dd

View File

@ -211,15 +211,18 @@ static HashTable *v8js_v8object_get_properties(zval *object) /* {{{ */
if (obj->properties == NULL) {
#if PHP_VERSION_ID >= 70300
zend_gc_status gc_status;
zend_gc_get_status(&gc_status);
if (gc_status.runs) {
/*
TODO: Fixme
The right way to handle this is to implement a get_gc() handler,
which is called instead of get_properties() during GC.
https://github.com/phpv8/v8js/pull/363#pullrequestreview-134439462
*/
#else
if (GC_G(gc_active)) {
#endif
/* the garbage collector is running, don't create more zvals */
return NULL;
}
#endif
ALLOC_HASHTABLE(obj->properties);
zend_hash_init(obj->properties, 0, NULL, ZVAL_PTR_DTOR, 0);