Browse Source

merged [402] [403] [404] from trunk: s/origin_compile_file/old_compile_file/g and init global vars

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.2@406 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 15 years ago
parent
commit
390ac1f0a5
  1. 10
      coverager.c
  2. 24
      xcache.c

10
coverager.c

@ -16,7 +16,7 @@ typedef HashTable *coverager_t;
#define PCOV_HEADER_MAGIC 0x564f4350
static char *xc_coveragedump_dir = NULL;
static zend_compile_file_t *origin_compile_file;
static zend_compile_file_t *old_compile_file = NULL;
#if 0
#define DEBUG
@ -453,7 +453,7 @@ static zend_op_array *xc_compile_file_for_coverage(zend_file_handle *h, int type
{
zend_op_array *op_array;
op_array = origin_compile_file(h, type TSRMLS_CC);
op_array = old_compile_file(h, type TSRMLS_CC);
if (op_array) {
if (XG(coverager)) {
xc_coverager_initenv(TSRMLS_C);
@ -482,7 +482,7 @@ void xc_coverager_handle_ext_stmt(zend_op_array *op_array, zend_uchar op) /* {{{
/* init/destroy */
int xc_coverager_init(int module_number TSRMLS_DC) /* {{{ */
{
origin_compile_file = zend_compile_file;
old_compile_file = zend_compile_file;
zend_compile_file = xc_compile_file_for_coverage;
if (cfg_get_string("xcache.coveragedump_directory", &xc_coveragedump_dir) == SUCCESS && xc_coveragedump_dir) {
@ -502,8 +502,8 @@ int xc_coverager_init(int module_number TSRMLS_DC) /* {{{ */
/* }}} */
void xc_coverager_destroy() /* {{{ */
{
if (origin_compile_file == xc_compile_file_for_coverage) {
zend_compile_file = origin_compile_file;
if (old_compile_file == xc_compile_file_for_coverage) {
zend_compile_file = old_compile_file;
}
if (xc_coveragedump_dir) {
xc_coveragedump_dir = NULL;

24
xcache.c

@ -97,8 +97,8 @@ static xc_cache_t **xc_php_caches = NULL;
static xc_cache_t **xc_var_caches = NULL;
static zend_bool xc_initized = 0;
static zend_compile_file_t *origin_compile_file;
static zend_llist_element *xc_llist_zend_extension;
static zend_compile_file_t *old_compile_file = NULL;
static zend_llist_element *xc_llist_zend_extension = NULL;
static zend_bool xc_test = 0;
static zend_bool xc_readonly_protection = 0;
@ -856,7 +856,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
}
if (!XG(cacher)) {
op_array = origin_compile_file(h, type TSRMLS_CC);
op_array = old_compile_file(h, type TSRMLS_CC);
#ifdef HAVE_XCACHE_OPTIMIZER
if (XG(optimizer)) {
xc_optimize(op_array TSRMLS_CC);
@ -875,7 +875,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
filename = h->opened_path ? h->opened_path : h->filename;
xce.data.php = &php;
if (!xc_entry_init_key_php(&xce, filename, opened_path_buffer TSRMLS_CC)) {
return origin_compile_file(h, type TSRMLS_CC);
return old_compile_file(h, type TSRMLS_CC);
}
cache = xce.cache;
/* }}} */
@ -883,7 +883,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
/* stale precheck */
if (cache->compiling) {
cache->clogs ++; /* is it safe here? */
return origin_compile_file(h, type TSRMLS_CC);
return old_compile_file(h, type TSRMLS_CC);
}
stored_xce = NULL;
@ -924,7 +924,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
/* clogged */
if (clogged) {
return origin_compile_file(h, type TSRMLS_CC);
return old_compile_file(h, type TSRMLS_CC);
}
/* }}} */
@ -941,7 +941,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
old_constinfo_cnt = zend_hash_num_elements(EG(zend_constants));
zend_try {
op_array = origin_compile_file(h, type TSRMLS_CC);
op_array = old_compile_file(h, type TSRMLS_CC);
} zend_catch {
catched = 1;
} zend_end_try();
@ -1374,9 +1374,9 @@ static void xc_destroy() /* {{{ */
{
xc_shm_t *shm = NULL;
if (origin_compile_file) {
zend_compile_file = origin_compile_file;
origin_compile_file = NULL;
if (old_compile_file) {
zend_compile_file = old_compile_file;
old_compile_file = NULL;
}
if (xc_php_caches) {
@ -1418,7 +1418,7 @@ static int xc_init(int module_number TSRMLS_DC) /* {{{ */
}
if (xc_php_size) {
origin_compile_file = zend_compile_file;
old_compile_file = zend_compile_file;
zend_compile_file = xc_compile_file;
CHECK(xc_php_caches = xc_cache_init(shm, &xc_php_hcache, &xc_php_hentry, xc_php_size), "failed init opcode cache");
@ -2745,7 +2745,7 @@ zend_module_entry xcache_module_entry = {
ZEND_GET_MODULE(xcache)
#endif
/* }}} */
static startup_func_t xc_last_ext_startup;
static startup_func_t xc_last_ext_startup = NULL;
static int xc_zend_startup_last(zend_extension *extension) /* {{{ */
{
/* restore */

Loading…
Cancel
Save