Changeset 311 for trunk/xcache.h


Ignore:
Timestamp:
2006-12-09T17:27:03+01:00 (8 years ago)
Author:
moo
Message:

restruct cached compile, add md5 table to recognize and merge file with same content

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.h

    r309 r311  
    165165typedef zend_op_array *(zend_compile_file_t)(zend_file_handle *h, int type TSRMLS_DC); 
    166166 
     167typedef struct _xc_entry_t xc_entry_t; 
     168typedef struct _xc_entry_data_php_t xc_entry_data_php_t; 
    167169/* {{{ xc_cache_t */ 
    168 typedef struct _xc_entry_t xc_entry_t; 
    169170typedef struct { 
    170171    int cacheid; 
     
    182183    xc_entry_t **entries; 
    183184    int entries_count; 
     185    xc_entry_data_php_t **phps; 
     186    int phps_count; 
    184187    xc_entry_t *deletes; 
    185188    int deletes_count; 
    186     xc_hash_t  *hentry; /* hash to entry */ 
     189    xc_hash_t  *hentry; /* hash settings to entry */ 
     190    xc_hash_t  *hphp;   /* hash settings to php */ 
    187191 
    188192    time_t     last_gc_deletes; 
     
    235239#endif 
    236240typedef enum { XC_TYPE_PHP, XC_TYPE_VAR } xc_entry_type_t; 
     241typedef char xc_md5sum_t[16]; 
    237242/* {{{ xc_entry_data_php_t */ 
    238 typedef struct { 
     243struct _xc_entry_data_php_t { 
     244    xc_hash_value_t hvalue; /* hash of md5 */ 
     245    xc_entry_data_php_t *next; 
     246    xc_cache_t *cache;      /* which cache it's on */ 
     247 
     248    xc_md5sum_t md5;        /* md5sum of the source */ 
     249    zend_ulong  refcount;   /* count of entries referencing to this data */ 
     250 
    239251    size_t sourcesize; 
    240 #ifdef HAVE_INODE 
    241     int device;             /* the filesystem device */ 
    242     int inode;              /* the filesystem inode */ 
    243 #endif 
    244     time_t mtime;           /* the mtime of origin source file */ 
     252    zend_ulong hits;        /* hits of this php */ 
     253    size_t     size; 
    245254 
    246255    zend_op_array *op_array; 
     
    262271    xc_autoglobal_t *autoglobals; 
    263272#endif 
    264 } xc_entry_data_php_t; 
     273 
     274    zend_bool  have_references; 
     275}; 
    265276/* }}} */ 
    266277/* {{{ xc_entry_data_var_t */ 
    267278typedef struct { 
    268279    zval   *value; 
     280 
     281    zend_bool  have_references; 
    269282} xc_entry_data_var_t; 
    270283/* }}} */ 
     
    278291 
    279292    size_t     size; 
    280     zend_ulong refcount; 
     293    zend_ulong refcount;    /* count of instances holding this entry */ 
    281294    zend_ulong hits; 
    282295    time_t     ctime;           /* the ctime of this entry */ 
     
    295308    } data; 
    296309 
    297     zend_bool  have_references; 
     310    time_t mtime;           /* the mtime of origin source file */ 
     311#ifdef HAVE_INODE 
     312    int device;             /* the filesystem device */ 
     313    int inode;              /* the filesystem inode */ 
     314#endif 
    298315}; 
    299316/* }}} */ 
Note: See TracChangeset for help on using the changeset viewer.