summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2012-12-05 16:02:47 +0400
committerDmitry Stogov <dmitry@zend.com>2012-12-05 16:02:47 +0400
commit27528b601f4a290ba50b202376a0064f17348027 (patch)
tree611d9fba2a37caacdaa773634ed5e22a123e12ca /Zend/zend_execute.c
parent26c165cc03267969ac313f2fd9a1fcb48435215d (diff)
downloadphp-git-27528b601f4a290ba50b202376a0064f17348027.tar.gz
Fixed comments
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index d260953bd7..1098c9efaf 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1572,12 +1572,14 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array
/*
* When allocating the execute_data, memory for compiled variables and
- * temporary variables is also allocated after the actual zend_execute_data
- * struct. op_array->last_var specifies the number of compiled variables and
- * op_array->T is the number of temporary variables. If there is no symbol
- * table, then twice as much memory is allocated for compiled variables.
- * In that case the first half contains zval**s and the second half the
- * actual zval*s (which would otherwise be in the symbol table).
+ * temporary variables is also allocated before and after the actual
+ * zend_execute_data struct. In addition we also allocate space to store
+ * information about syntactically nested called functions and actual
+ * parameters. op_array->last_var specifies the number of compiled
+ * variables and op_array->T is the number of temporary variables. If there
+ * is no symbol table, then twice as much memory is allocated for compiled
+ * variables. In that case the first half contains zval**s and the second
+ * half the actual zval*s (which would otherwise be in the symbol table).
*/
size_t execute_data_size = ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data));
size_t CVs_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval **) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2));
@@ -1592,8 +1594,9 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array
* though this behavior would be suboptimal, because the (rather large)
* structure would have to be copied back and forth every time execution is
* suspended or resumed. That's why for generators the execution context
- * is allocated using emalloc, thus allowing to save and restore it simply
- * by replacing a pointer.
+ * is allocated using a separate VM stack, thus allowing to save and
+ * restore it simply by replacing a pointer. The same segment also keeps
+ * a copy of previous execute_data and passed parameters.
*/
if (op_array->fn_flags & ZEND_ACC_GENERATOR) {
/* Prepend the regular stack frame with copy on prev_execute_data