Changeset 1468 in svn for trunk/mod_cacher/xc_cacher.c


Ignore:
Timestamp:
2013-11-12T09:46:04Z (22 months ago)
Author:
Xuefer
Message:

clean up shm handlers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1460 r1468  
    176176    php->hits     = 0;
    177177    php->refcount = 0;
    178     stored_php = xc_processor_store_xc_entry_data_php_t(cache->shm, cache->allocator, php TSRMLS_CC);
     178    stored_php = xc_processor_store_xc_entry_data_php_t(cache->shm->readonlydiff, cache->allocator, php TSRMLS_CC);
    179179#if 0
    180180    {
     
    313313    entry->atime = XG(request_time);
    314314    stored_entry = type == XC_TYPE_PHP
    315         ? (xc_entry_t *) xc_processor_store_xc_entry_php_t(cache->shm, cache->allocator, (xc_entry_php_t *) entry TSRMLS_CC)
    316         : (xc_entry_t *) xc_processor_store_xc_entry_var_t(cache->shm, cache->allocator, (xc_entry_var_t *) entry TSRMLS_CC);
     315        ? (xc_entry_t *) xc_processor_store_xc_entry_php_t(cache->shm->readonlydiff, cache->allocator, (xc_entry_php_t *) entry TSRMLS_CC)
     316        : (xc_entry_t *) xc_processor_store_xc_entry_var_t(cache->shm->readonlydiff, cache->allocator, (xc_entry_var_t *) entry TSRMLS_CC);
    317317    if (stored_entry) {
    318318        xc_entry_add_unlocked(cache->cached, entryslotid, stored_entry);
     
    22412241        for (i = 0; i < xc_php_hcache.size; i ++) {
    22422242            shm = xc_php_caches[i].shm;
    2243             if (shm->handlers->is_readwrite(shm, p)) {
     2243            if (shm->vtable->is_readwrite(shm, p)) {
    22442244                return 1;
    22452245            }
     
    22502250        for (i = 0; i < xc_var_hcache.size; i ++) {
    22512251            shm = xc_var_caches[i].shm;
    2252             if (shm->handlers->is_readwrite(shm, p)) {
     2252            if (shm->vtable->is_readwrite(shm, p)) {
    22532253                return 1;
    22542254            }
     
    22662266        for (i = 0; i < xc_php_hcache.size; i ++) {
    22672267            shm = xc_php_caches[i].shm;
    2268             if (shm->handlers->is_readonly(shm, p)) {
     2268            if (shm->vtable->is_readonly(shm, p)) {
    22692269                return 1;
    22702270            }
     
    22752275        for (i = 0; i < xc_var_hcache.size; i ++) {
    22762276            shm = xc_var_caches[i].shm;
    2277             if (shm->handlers->is_readonly(shm, p)) {
     2277            if (shm->vtable->is_readonly(shm, p)) {
    22782278                return 1;
    22792279            }
     
    26382638            shm = cache->shm;
    26392639            if (shm) {
    2640                 cache->shm->handlers->memdestroy(cache->allocator);
     2640                cache->shm->vtable->memdestroy(cache->allocator);
    26412641            }
    26422642        }
     
    26712671    for (i = 0; i < hcache->size; i ++) {
    26722672        xc_cache_t *cache = &caches[i];
    2673         CHECK(allocator = shm->handlers->meminit(shm, memsize), "Failed init shm");
     2673        CHECK(allocator = shm->vtable->meminit(shm, memsize), "Failed init shm");
    26742674        if (!(allocator->vtable = xc_allocator_find(allocator_name))) {
    26752675            zend_error(E_ERROR, "Allocator %s not found", allocator_name);
     
    27462746    if (xc_php_size || xc_var_size) {
    27472747        CHECK(shm = xc_shm_init(xc_shm_scheme, shmsize, xc_readonly_protection, xc_mmap_path, NULL), "Cannot create shm");
    2748         if (!shm->handlers->can_readonly(shm)) {
     2748        if (!xc_shm_can_readonly(shm)) {
    27492749            xc_readonly_protection = 0;
    27502750        }
     
    34703470                RETVAL_LONG(value);
    34713471
    3472                 zv = (zval *) cache->shm->handlers->to_readwrite(cache->shm, (char *) stored_entry_var->value);
     3472                zv = (zval *) xc_shm_to_readwrite(cache->shm, (char *) stored_entry_var->value);
    34733473                Z_LVAL_P(zv) = value;
    34743474                ++cache->cached->updates;
Note: See TracChangeset for help on using the changeset viewer.