Changeset 1132 for trunk


Ignore:
Timestamp:
2012-08-09T05:43:48+02:00 (3 years ago)
Author:
moo
Message:

cacher: hide more detail

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cache.h

    r1062 r1132  
    1717struct _xc_lock_t;
    1818struct _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 /* }}} */
    3319/* {{{ xc_op_array_info_detail_t */
    3420typedef struct {
  • trunk/mod_cacher/xc_cacher.c

    r1129 r1132  
    9494};
    9595/* }}} */
     96typedef 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/* }}} */
    96109
    97110/* {{{ globals */
     
    150163    php->hits     = 0;
    151164    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);
    153166    if (stored_php) {
    154167        xc_php_add_unlocked(cache->cached, stored_php);
     
    297310    entry->atime = XG(request_time);
    298311    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);
    301314    if (stored_entry) {
    302315        xc_entry_add_unlocked(cache->cached, entryslotid, stored_entry);
     
    32853298static PHP_MINIT_FUNCTION(xcache_cacher) /* {{{ */
    32863299{
    3287     char *env;
    32883300    zend_extension *ext;
    32893301    zend_llist_position lpos;
  • trunk/processor/head.m4

    r1051 r1132  
    9494    const xc_entry_data_php_t *php_src;
    9595    const xc_entry_data_php_t *php_dst;
    96     const xc_cache_t          *cache;
     96    xc_shm_t                  *shm;
     97    xc_mem_t                  *mem;
    9798    const zend_class_entry *cache_ce;
    9899    zend_uint cache_class_index;
     
    394395dnl ================ export API
    395396define(`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) {
    398399    $1 *dst;
    399400    xc_processor_t processor;
     
    401402    memset(&processor, 0, sizeof(processor));
    402403    processor.reference = 1;
    403     processor.cache = cache;
     404    processor.shm = shm;
     405    processor.mem = mem;
    404406
    405407    IFAUTOCHECK(`xc_stack_init(&processor.allocsizes);')
     
    439441
    440442        /* 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);
    442444        if (processor.p == NULL) {
    443445            dst = NULL;
  • trunk/processor/main.m4

    r877 r1132  
    126126define(`FIXPOINTER', `FIXPOINTER_EX(`$1', `dst->$2')')
    127127define(`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);
    129129')')
    130130define(`UNFIXPOINTER', `UNFIXPOINTER_EX(`$1', `dst->$2')')
    131131define(`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);
    133133')')
    134134dnl }}}
Note: See TracChangeset for help on using the changeset viewer.