Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Optimize argument_stack top lookup

* Fix a nasty bug in zend_ptr_stack_clean()
  • Loading branch information...
commit 3fcc6511f6555ca6af5f26ee6313097c42aee9ba 1 parent 533f135
@andigutmans andigutmans authored
View
2  Zend/libzend.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "COMPILE_LIBZEND" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "COMPILE_LIBZEND" /FR /YX /FD /c
# ADD BASE RSC /l 0x40d /d "NDEBUG"
# ADD RSC /l 0x40d /d "NDEBUG"
BSC32=bscmake.exe
View
6 Zend/zend_API.c
@@ -33,7 +33,7 @@ HashTable list_destructors, module_registry;
/* this function doesn't check for too many parameters */
int getParameters(int ht, int param_count,...)
{
- void **p = EG(argument_stack).elements+EG(argument_stack).top-1;
+ void **p = EG(argument_stack).top_element-1;
int arg_count = (ulong) *p;
va_list ptr;
zval **param, *param_ptr;
@@ -57,6 +57,7 @@ int getParameters(int ht, int param_count,...)
new_tmp->refcount = 1;
new_tmp->is_ref = 0;
param_ptr = new_tmp;
+ ((zval *) *(p-param_count))->refcount--;
*(p-param_count) = param_ptr;
}
*param = param_ptr;
@@ -70,7 +71,7 @@ int getParameters(int ht, int param_count,...)
int getParametersArray(int ht, int param_count, zval **argument_array)
{
- void **p = EG(argument_stack).elements+EG(argument_stack).top-1;
+ void **p = EG(argument_stack).top_element-1;
int arg_count = (ulong) *p;
zval *param_ptr;
ELS_FETCH();
@@ -91,6 +92,7 @@ int getParametersArray(int ht, int param_count, zval **argument_array)
new_tmp->refcount = 1;
new_tmp->is_ref = 0;
param_ptr = new_tmp;
+ ((zval *) *(p-param_count))->refcount--;
*(p-param_count) = param_ptr;
}
*(argument_array++) = param_ptr;
View
2  Zend/zend_execute_API.c
@@ -466,7 +466,7 @@ ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D)
ZEND_API int zend_ptr_stack_get_arg(int requested_arg, void **data)
{
- void **p = EG(argument_stack).elements+EG(argument_stack).top-1;
+ void **p = EG(argument_stack).top_element-1;
int arg_count = (ulong) *p;
if (requested_arg>arg_count) {
View
1  Zend/zend_ptr_stack.c
@@ -68,6 +68,7 @@ ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *))
{
zend_ptr_stack_apply(stack, func);
stack->top = 0;
+ stack->top_element = stack->elements;
}
Please sign in to comment.
Something went wrong with that request. Please try again.