Changeset 1132
- Timestamp:
- 2012-08-09T05:43:48+02:00 (10 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
mod_cacher/xc_cache.h (modified) (1 diff)
-
mod_cacher/xc_cacher.c (modified) (4 diffs)
-
processor/head.m4 (modified) (4 diffs)
-
processor/main.m4 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/mod_cacher/xc_cache.h
r1062 r1132 17 17 struct _xc_lock_t; 18 18 struct _xc_shm_t; 19 /* {{{ xc_cache_t: only cache info, not in shm */20 typedef struct {21 int cacheid;22 xc_hash_t *hcache; /* hash to cacheid */23 24 struct _xc_lock_t *lck;25 struct _xc_shm_t *shm; /* which shm contains us */26 struct _xc_mem_t *mem; /* which mem contains us */27 28 xc_hash_t *hentry; /* hash settings to entry */29 xc_hash_t *hphp; /* hash settings to php */30 xc_cached_t *cached;31 } xc_cache_t;32 /* }}} */33 19 /* {{{ xc_op_array_info_detail_t */ 34 20 typedef struct { -
trunk/mod_cacher/xc_cacher.c
r1129 r1132 94 94 }; 95 95 /* }}} */ 96 typedef struct { /* {{{ xc_cache_t: only cache info, not in shm */ 97 int cacheid; 98 xc_hash_t *hcache; /* hash to cacheid */ 99 100 struct _xc_lock_t *lck; 101 struct _xc_shm_t *shm; /* which shm contains us */ 102 struct _xc_mem_t *mem; /* which mem contains us */ 103 104 xc_hash_t *hentry; /* hash settings to entry */ 105 xc_hash_t *hphp; /* hash settings to php */ 106 xc_cached_t *cached; 107 } xc_cache_t; 108 /* }}} */ 96 109 97 110 /* {{{ globals */ … … 150 163 php->hits = 0; 151 164 php->refcount = 0; 152 stored_php = xc_processor_store_xc_entry_data_php_t(cache , php TSRMLS_CC);165 stored_php = xc_processor_store_xc_entry_data_php_t(cache->shm, cache->mem, php TSRMLS_CC); 153 166 if (stored_php) { 154 167 xc_php_add_unlocked(cache->cached, stored_php); … … 297 310 entry->atime = XG(request_time); 298 311 stored_entry = type == XC_TYPE_PHP 299 ? (xc_entry_t *) xc_processor_store_xc_entry_php_t(cache , (xc_entry_php_t *) entry TSRMLS_CC)300 : (xc_entry_t *) xc_processor_store_xc_entry_var_t(cache , (xc_entry_var_t *) entry TSRMLS_CC);312 ? (xc_entry_t *) xc_processor_store_xc_entry_php_t(cache->shm, cache->mem, (xc_entry_php_t *) entry TSRMLS_CC) 313 : (xc_entry_t *) xc_processor_store_xc_entry_var_t(cache->shm, cache->mem, (xc_entry_var_t *) entry TSRMLS_CC); 301 314 if (stored_entry) { 302 315 xc_entry_add_unlocked(cache->cached, entryslotid, stored_entry); … … 3285 3298 static PHP_MINIT_FUNCTION(xcache_cacher) /* {{{ */ 3286 3299 { 3287 char *env;3288 3300 zend_extension *ext; 3289 3301 zend_llist_position lpos; -
trunk/processor/head.m4
r1051 r1132 94 94 const xc_entry_data_php_t *php_src; 95 95 const xc_entry_data_php_t *php_dst; 96 const xc_cache_t *cache; 96 xc_shm_t *shm; 97 xc_mem_t *mem; 97 98 const zend_class_entry *cache_ce; 98 99 zend_uint cache_class_index; … … 394 395 dnl ================ export API 395 396 define(`DEFINE_STORE_API', ` 396 /* export: $1 *xc_processor_store_$1(xc_ cache_t *cache, $1 *src TSRMLS_DC); :export {{{ */397 $1 *xc_processor_store_$1(xc_ cache_t *cache, $1 *src TSRMLS_DC) {397 /* export: $1 *xc_processor_store_$1(xc_shm_t *shm, xc_mem_t *mem, $1 *src TSRMLS_DC); :export {{{ */ 398 $1 *xc_processor_store_$1(xc_shm_t *shm, xc_mem_t *mem, $1 *src TSRMLS_DC) { 398 399 $1 *dst; 399 400 xc_processor_t processor; … … 401 402 memset(&processor, 0, sizeof(processor)); 402 403 processor.reference = 1; 403 processor.cache = cache; 404 processor.shm = shm; 405 processor.mem = mem; 404 406 405 407 IFAUTOCHECK(`xc_stack_init(&processor.allocsizes);') … … 439 441 440 442 /* mem :) */ 441 processor.p = (char *) processor. cache->mem->handlers->malloc(processor.cache->mem, processor.size);443 processor.p = (char *) processor.mem->handlers->malloc(processor.mem, processor.size); 442 444 if (processor.p == NULL) { 443 445 dst = NULL; -
trunk/processor/main.m4
r877 r1132 126 126 define(`FIXPOINTER', `FIXPOINTER_EX(`$1', `dst->$2')') 127 127 define(`FIXPOINTER_EX', `IFSTORE(` 128 $2 = ($1 *) processor-> cache->shm->handlers->to_readonly(processor->cache->shm, (char *)$2);128 $2 = ($1 *) processor->shm->handlers->to_readonly(processor->shm, (char *)$2); 129 129 ')') 130 130 define(`UNFIXPOINTER', `UNFIXPOINTER_EX(`$1', `dst->$2')') 131 131 define(`UNFIXPOINTER_EX', `IFSTORE(` 132 $2 = ($1 *) processor-> cache->shm->handlers->to_readwrite(processor->cache->shm, (char *)$2);132 $2 = ($1 *) processor->shm->handlers->to_readwrite(processor->shm, (char *)$2); 133 133 ')') 134 134 dnl }}}
Note: See TracChangeset
for help on using the changeset viewer.

