Optimizer compilation fix

From: Date: Tue, 06 Oct 2009 00:26:18 +0000
Subject: Optimizer compilation fix
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-6669@lists.php.net to get a copy of this message
Hi, It seems that current optimizer code (trunk) will not compile in any platform. I have attached the patch which fixes the compilation issues. I have been using this extension for an ecommerce workload benchmarking for some time and found it very useful. I also submitted a patch some time back but it was never looked at. http://pecl.php.net/bugs/bug.php?id=15945 I would like to participate in development of this extension. Right now I have karma in memsession extension. Regards, Basant.

Index: optimize.c =================================================================== --- optimize.c (revision 289234) +++ optimize.c (working copy) @@ -4316,7 +4316,7 @@ return op_array; } - if ((jmp_lines = do_alloca(sizeof(int) * op_array->last, jmp_lines_use_heap)) == NULL) { + if ((jmp_lines = optimizer_do_alloca(sizeof(int) * op_array->last, jmp_lines_use_heap)) == NULL) { return NULL; } @@ -4349,8 +4349,8 @@ } /* Allocate memory for CFG */ - if ((cb = do_alloca(sizeof(CB)*(op_array->last+1), cb_use_heap)) == NULL) { - free_alloca(jmp_lines, jmp_lines_use_heap); + if ((cb = optimizer_do_alloca(sizeof(CB)*(op_array->last+1), cb_use_heap)) == NULL) { + optimizer_free_alloca(jmp_lines, jmp_lines_use_heap); return NULL; } memset(cb, 0, sizeof(CB) * (op_array->last + 1)); @@ -4365,13 +4365,13 @@ /* Find all blocks and build CFG */ if (build_cfg(op_array, cb)) { OPTIMIZER_ALLOCA_FLAG(global_use_heap) - char *global = do_alloca(op_array->T * sizeof(char), global_use_heap); + char *global = optimizer_do_alloca(op_array->T * sizeof(char), global_use_heap); //optimizer_dump_cfg_graphviz(cb, op_array); if (global == NULL) { - free_alloca(cb, cb_use_heap); - free_alloca(jmp_lines, jmp_lines_use_heap); + optimizer_free_alloca(cb, cb_use_heap); + optimizer_free_alloca(jmp_lines, jmp_lines_use_heap); return NULL; } @@ -4433,10 +4433,10 @@ /* Store Optimized Code */ generate_cfg(op_array, cb); rebuild_var_list(op_array, cb, global); - free_alloca(global, global_use_heap); + optimizer_free_alloca(global, global_use_heap); } - free_alloca(cb, cb_use_heap); - free_alloca(jmp_lines, jmp_lines_use_heap); + optimizer_free_alloca(cb, cb_use_heap); + optimizer_free_alloca(jmp_lines, jmp_lines_use_heap); if (zend_hash_find(EG(active_symbol_table), "php_errormsg", sizeof("php_errormsg"), (void **)&tmp) == SUCCESS) { Index: optimize.h =================================================================== --- optimize.h (revision 289234) +++ optimize.h (working copy) @@ -407,7 +407,7 @@ # define OPTIMIZER_ALLOCA_FLAG(name) # define OPTIMIZER_ALLOCA_SET_FLAG(name) # define optimizer_do_alloca(v, f) do_alloca(v) -# define optimizer_free_alloca(v, f) free_alloca(v, f) +# define optimizer_free_alloca(v, f) free_alloca(v) #endif Index: php_optimizer.c =================================================================== --- php_optimizer.c (revision 289234) +++ php_optimizer.c (working copy) @@ -190,7 +190,7 @@ zend_ini_entry* apc_enabled = NULL; if (zend_hash_find(EG(ini_directives), "apc.enabled", sizeof("apc.enabled"), (void**)&apc_enabled) == SUCCESS) { - if (optimizer_ini_bool_decode(apc_enabled.value_length, apc_enabled.value)) { + if (optimizer_ini_bool_decode(apc_enabled->value_length, apc_enabled->value)) { compile_f_reg = OPTIMIZER_COMPILE_APC_REG; } } else {
« previous php.pecl.dev (#6669) next »