Ignore:
Timestamp:
2012-03-27T18:07:50+02:00 (3 years ago)
Author:
moo
Message:

more readability cache property. reduce memory footprint for data caching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r846 r851  
    8282    zend_bool reference; /* enable if to deal with reference */ 
    8383    zend_bool have_references; 
    84     const xc_entry_t *entry_src; 
    85     const xc_entry_t *entry_dst; 
     84    const xc_entry_php_t *entry_php_src; 
     85    const xc_entry_php_t *entry_php_dst; 
    8686    const xc_entry_data_php_t *php_src; 
    8787    const xc_entry_data_php_t *php_dst; 
     
    396396    memset(&processor, 0, sizeof(processor)); 
    397397    processor.reference = 1; 
    398     processor.cache = src->cache; 
     398    processor.cache = src->ifelse(`$1', `xc_entry_php_t', entry.)cache; 
    399399 
    400400    IFASSERT(`xc_stack_init(&processor.allocsizes);') 
     
    416416        zend_hash_destroy(&processor.strings); 
    417417    } 
    418     src->size = processor.size; 
    419     ifelse(`$1', `xc_entry_t', ` 
    420         src->data.var->have_references = processor.have_references; 
    421     ', ` 
    422         src->have_references = processor.have_references; 
    423     ') 
     418    src->ifelse(`$1', `xc_entry_php_t', entry.)size = processor.size; 
     419    ifelse( 
     420        `$1', `xc_entry_t', `src->data.var.have_references = processor.have_references;', 
     421        `$1', `xc_entry_data_php_t', `src->have_references = processor.have_references;' 
     422    ) 
    424423 
    425424    IFASSERT(`xc_stack_reverse(&processor.allocsizes);') 
     
    469468') 
    470469DEFINE_STORE_API(`xc_entry_t') 
     470DEFINE_STORE_API(`xc_entry_php_t') 
    471471DEFINE_STORE_API(`xc_entry_data_php_t') 
    472 /* export: xc_entry_t *xc_processor_restore_xc_entry_t(xc_entry_t *dst, const xc_entry_t *src TSRMLS_DC); :export {{{ */ 
    473 xc_entry_t *xc_processor_restore_xc_entry_t(xc_entry_t *dst, const xc_entry_t *src TSRMLS_DC) { 
     472/* export: xc_entry_php_t *xc_processor_restore_xc_entry_php_t(xc_entry_php_t *dst, const xc_entry_php_t *src TSRMLS_DC); :export {{{ */ 
     473xc_entry_php_t *xc_processor_restore_xc_entry_php_t(xc_entry_php_t *dst, const xc_entry_php_t *src TSRMLS_DC) { 
    474474    xc_processor_t processor; 
    475475 
    476476    memset(&processor, 0, sizeof(processor)); 
    477     xc_restore_xc_entry_t(&processor, dst, src TSRMLS_CC); 
     477    xc_restore_xc_entry_php_t(&processor, dst, src TSRMLS_CC); 
    478478 
    479479    return dst; 
    480480} 
    481481/* }}} */ 
    482 /* export: xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_t *xce, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC); :export {{{ */ 
    483 xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_t *xce, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC) { 
     482/* export: xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_php_t *xce, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC); :export {{{ */ 
     483xc_entry_data_php_t *xc_processor_restore_xc_entry_data_php_t(const xc_entry_php_t *xce, xc_entry_data_php_t *dst, const xc_entry_data_php_t *src, zend_bool readonly_protection TSRMLS_DC) { 
    484484    xc_processor_t processor; 
    485485 
     
    490490        processor.reference = 1; 
    491491    } 
    492     processor.entry_src = xce; 
     492    processor.entry_php_src = xce; 
    493493 
    494494    if (processor.reference) { 
     
    499499        zend_hash_destroy(&processor.zvalptrs); 
    500500    } 
     501    return dst; 
     502} 
     503/* }}} */ 
     504/* export: xc_entry_t *xc_processor_restore_xc_entry_t(xc_entry_t *dst, const xc_entry_t *src TSRMLS_DC); :export {{{ */ 
     505xc_entry_t *xc_processor_restore_xc_entry_t(xc_entry_t *dst, const xc_entry_t *src TSRMLS_DC) { 
     506    xc_processor_t processor; 
     507 
     508    memset(&processor, 0, sizeof(processor)); 
     509    xc_restore_xc_entry_t(&processor, dst, src TSRMLS_CC); 
     510 
    501511    return dst; 
    502512} 
     
    522532} 
    523533/* }}} */ 
    524 /* export: void xc_dprint(xc_entry_t *src, int indent TSRMLS_DC); :export {{{ */ 
     534/* export: void xc_dprint(xc_entry_php_t *src, int indent TSRMLS_DC); :export {{{ */ 
    525535#ifdef HAVE_XCACHE_DPRINT 
    526 void xc_dprint(xc_entry_t *src, int indent TSRMLS_DC) { 
     536void xc_dprint(xc_entry_php_t *src, int indent TSRMLS_DC) { 
    527537    IFDPRINT(`INDENT()`'fprintf(stderr, "xc_entry_t:src");') 
    528538    xc_dprint_xc_entry_t(src, indent TSRMLS_CC); 
Note: See TracChangeset for help on using the changeset viewer.