1
0
Fork 0

add xc_php_addref_dmz and s/xc_php_remove_dmz/xc_php_release_dmz/

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@323 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2006-12-10 08:18:09 +00:00
parent 78ea9ed121
commit fc2be9a6a4
1 changed files with 10 additions and 6 deletions

View File

@ -147,7 +147,12 @@ static void xc_php_free_dmz(xc_entry_data_php_t *php) /* {{{ */
php->cache->mem->handlers->free(php->cache->mem, (xc_entry_data_php_t *)php);
}
/* }}} */
static void xc_php_remove_dmz(xc_entry_data_php_t *php) /* {{{ */
static void xc_php_addref_dmz(xc_entry_data_php_t *php) /* {{{ */
{
php->refcount ++;
}
/* }}} */
static void xc_php_release_dmz(xc_entry_data_php_t *php) /* {{{ */
{
if (-- php->refcount == 0) {
xc_entry_data_php_t **pp = &(php->cache->phps[php->hvalue]);
@ -236,7 +241,7 @@ static xc_entry_t *xc_entry_store_dmz(xc_entry_t *xce TSRMLS_DC) /* {{{ */
static void xc_entry_free_real_dmz(volatile xc_entry_t *xce) /* {{{ */
{
if (xce->type == XC_TYPE_PHP) {
xc_php_remove_dmz(xce->data.php);
xc_php_release_dmz(xce->data.php);
}
xce->cache->mem->handlers->free(xce->cache->mem, (xc_entry_t *)xce);
}
@ -1290,21 +1295,20 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
/* php_store */
if (newlycompiled) {
stored_php = xc_php_store_dmz(&php TSRMLS_CC);
/* error */
if (!stored_php) {
/* error */
break;
}
}
/* entry_store */
xc_php_addref_dmz(stored_php);
stored_xce = xc_entry_store_dmz(&xce TSRMLS_CC);
if (stored_xce) {
stored_xce->data.php = stored_php;
stored_php->refcount ++;
}
else {
/* error */
xc_php_remove_dmz(stored_php);
stored_php = NULL;
xc_php_release_dmz(stored_php);
}
} LEAVE_LOCK_EX(cache);
/* }}} */