rfc:remove_zend_api:scratchpad
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:remove_zend_api:scratchpad [2009/05/14 13:56] – Fix formatting wharmby | rfc:remove_zend_api:scratchpad [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 21: | Line 21: | ||
The zend engine recognizes two types of memory. There is memory that is allocated " | The zend engine recognizes two types of memory. There is memory that is allocated " | ||
- | - Memory that is used only during | + | - Memory that is used only during |
- | - Memory that is allocated from the temporary heap on one extension function call but accessed on a later call without a reference explicitly being passed back to the extension on the subsequent call. (the extension caches a pointer to the memory) | + | - Memory that is allocated from the temporary heap on one extension function call but accessed on a later call, e.g the extension caches a pointer to the memory |
- Persistent memory that persists from request to request. | - Persistent memory that persists from request to request. | ||
Case 2 causes a problem if we assume that we do not want the extensions to participate in the VM garbage collection scheme. | Case 2 causes a problem if we assume that we do not want the extensions to participate in the VM garbage collection scheme. | ||
- | There is an example of this in the XML extension (need reference.) | + | There is an example of this in the XML extension |
+ | |||
+ | ALLOC_ZVAL(parser-> | ||
+ | *parser-> | ||
+ | zval_copy_ctor(parser-> | ||
+ | INIT_PZVAL(parser-> | ||
+ | |||
+ | The above code creates a new zval and sets a reference | ||
+ | |||
+ | |||
== Solution used in Project Zero == | == Solution used in Project Zero == | ||
- | Projectzero assumes case 1 for all function calls. | + | Projectzero assumes case 1 for all function calls. i.e all non-persistent memory is freed. |
ProjectZero | ProjectZero | ||
rfc/remove_zend_api/scratchpad.1242309417.txt.gz · Last modified: 2017/09/22 13:28 (external edit)