rfc:runtimecache
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:runtimecache [2010/05/18 07:07] – created dmitry | rfc:runtimecache [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2010-05-17 | * Date: 2010-05-17 | ||
* Author: Dmitry Stogov < | * Author: Dmitry Stogov < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 49: | Line 49: | ||
* {{rfc: | * {{rfc: | ||
+ | ===== Notes for Extension Maintainers ===== | ||
+ | |||
+ | As was said before the patch modifies zend_class_entry and zend_object structure, so in case the extension works with properties directly it should be modified a bit. The key changes which may affect the extensions are in zend.h | ||
+ | |||
+ | <code diff> | ||
+ | Index: Zend/zend.h | ||
+ | =================================================================== | ||
+ | --- Zend/ | ||
+ | +++ Zend/ | ||
+ | @@ -298,6 +298,7 @@ | ||
+ | | ||
+ | | ||
+ | | ||
+ | + zval **properties_table; | ||
+ | | ||
+ | } zend_object; | ||
+ | |||
+ | @@ -468,11 +469,13 @@ | ||
+ | | ||
+ | |||
+ | | ||
+ | - HashTable default_properties; | ||
+ | | ||
+ | - HashTable default_static_members; | ||
+ | - HashTable *static_members; | ||
+ | + zval **default_properties_table; | ||
+ | + zval **default_static_members_table; | ||
+ | + zval **static_members_table; | ||
+ | | ||
+ | + int default_properties_count; | ||
+ | + int default_static_members_count; | ||
+ | | ||
+ | |||
+ | | ||
+ | </ | ||
+ | |||
+ | For example property initialization in class constructors should be done using a special function instead of direct HashTable copying. Such copying isn't possible any more because default_properties HashTable is replaced with plain array - default_properties_table. | ||
+ | |||
+ | <code diff> | ||
+ | Index: ext/ | ||
+ | =================================================================== | ||
+ | --- ext/ | ||
+ | +++ ext/ | ||
+ | @@ -129,7 +128,7 @@ | ||
+ | | ||
+ | |||
+ | | ||
+ | - zend_hash_copy(intern-> | ||
+ | + object_properties_init(& | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | In case extension accesses object properties in HashTable it has to check if such HashTable initialized and rebuld it if necessary. | ||
+ | |||
+ | <code diff> | ||
+ | Index: ext/ | ||
+ | =================================================================== | ||
+ | --- ext/ | ||
+ | +++ ext/ | ||
+ | @@ -523,6 +522,9 @@ | ||
+ | | ||
+ | | ||
+ | |||
+ | + if (!intern-> | ||
+ | + rebuild_object_properties(& | ||
+ | + } | ||
+ | | ||
+ | |||
+ | | ||
+ | </ |
rfc/runtimecache.1274166431.txt.gz · Last modified: 2017/09/22 13:28 (external edit)