Changeset 205

Show
Ignore:
Timestamp:
05/04/06 15:00:20 (2 years ago)
Author:
bart
Message:

Don't store the doc_comments in op_array and class_entry. They are
useless. this should reduce memory footprint.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r204 r205  
     12006-05-04  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
     2 
     3        * Don't store the doc_comments in op_array and class_entry. They are  
     4          useless. this should reduce memory footprint. 
     5 
    162006-04-13  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
    27 
  • eaccelerator/trunk/ea_restore.c

    r201 r205  
    256256#endif 
    257257        FIXUP(from->filename); 
    258 #ifdef ZEND_ENGINE_2 
    259         FIXUP(from->doc_comment); 
    260 #endif 
    261258} 
    262259 
     
    267264#ifdef ZEND_ENGINE_2 
    268265        FIXUP(from->filename); 
    269         FIXUP(from->doc_comment); 
    270266        fixup_zval_hash(&from->constants_table); 
    271267        fixup_zval_hash(&from->default_properties); 
     
    648644        to->line_start = from->line_start; 
    649645        to->line_end = from->line_end; 
    650         to->doc_comment_len = from->doc_comment_len; 
    651         to->doc_comment = from->doc_comment; 
    652         /*??? 
    653            if (from->doc_comment != NULL) { 
    654            to->doc_comment = emalloc(from->doc_comment_len+1); 
    655            memcpy(to->doc_comment, from->doc_comment, from->doc_comment_len+1); 
    656            } 
    657          */ 
     646        to->doc_comment_len = 0; 
     647        to->doc_comment = NULL; 
    658648#else 
    659649        to->uses_globals = from->uses_globals; 
     
    709699        memcpy(to->name, from->name, from->name_length + 1); 
    710700#ifdef ZEND_ENGINE_2_1 
    711         if (from->doc_comment != NULL) { 
    712                 to->doc_comment = emalloc(from->doc_comment_len+1); 
    713                 memcpy(to->doc_comment, from->doc_comment, from->doc_comment_len+1); 
    714         } 
     701    to->doc_comment_len = 0; 
     702    to->doc_comment = NULL; 
    715703#endif 
    716704        return to; 
     
    857845        to->line_start = from->line_start; 
    858846        to->line_end = from->line_end; 
    859         to->doc_comment_len = from->doc_comment_len; 
     847        to->doc_comment_len = 0; 
     848    to->doc_comment = NULL; 
    860849/*      if (from->filename != NULL) { 
    861850                size_t len = strlen(from->filename) + 1; 
     
    864853        }*/ 
    865854        to->filename = from->filename; 
    866         if (from->doc_comment != NULL) { 
    867                 to->doc_comment = emalloc(from->doc_comment_len + 1); 
    868                 memcpy(to->doc_comment, from->doc_comment, from->doc_comment_len + 1); 
    869         } 
    870855 
    871856        /* restore constants table */ 
  • eaccelerator/trunk/ea_store.c

    r201 r205  
    7979        EAG(mem) += sizeof(zend_property_info); 
    8080        calc_string(from->name, from->name_length + 1 TSRMLS_CC); 
    81 #ifdef ZEND_ENGINE_2_1 
    82         if (from->doc_comment != NULL) { 
    83                 calc_string(from->doc_comment, from->doc_comment_len + 1 TSRMLS_CC); 
    84         } 
    85 #endif 
    8681} 
    8782 
     
    263258        if (from->filename != NULL) 
    264259                calc_string(from->filename, strlen(from->filename) + 1 TSRMLS_CC); 
    265 #ifdef ZEND_ENGINE_2 
    266         if (from->doc_comment != NULL) 
    267                 calc_string(from->doc_comment, from->doc_comment_len + 1 TSRMLS_CC); 
    268 #endif 
    269260} 
    270261 
     
    286277        if (from->filename != NULL) 
    287278                calc_string(from->filename, strlen(from->filename) + 1 TSRMLS_CC); 
    288         if (from->doc_comment != NULL) 
    289                 calc_string(from->doc_comment, from->doc_comment_len + 1 TSRMLS_CC); 
    290  
    291         calc_zval_hash(&from->constants_table); 
     279         
     280    calc_zval_hash(&from->constants_table); 
    292281        calc_zval_hash(&from->default_properties); 
    293282 
     
    729718        to->line_start = from->line_start; 
    730719        to->line_end = from->line_end; 
    731         to->doc_comment_len = from->doc_comment_len; 
    732         if (from->doc_comment != NULL) 
    733                 to->doc_comment = store_string(from->doc_comment, from->doc_comment_len + 1 TSRMLS_CC); 
    734720#endif 
    735721        return to; 
     
    746732        to->name = store_string(from->name, from->name_length + 1 TSRMLS_CC); 
    747733#ifdef ZEND_ENGINE_2_1 
    748         to->doc_comment_len = from->doc_comment_len; 
    749         if (from->doc_comment != NULL) { 
    750                 to->doc_comment = store_string(from->doc_comment, from->doc_comment_len + 1 TSRMLS_CC); 
    751         } 
     734        to->doc_comment_len = 0; 
     735        to->doc_comment = NULL; 
    752736#endif 
    753737        return to; 
     
    893877        to->line_start = from->line_start; 
    894878        to->line_end = from->line_end; 
    895         to->doc_comment_len = from->doc_comment_len; 
    896879 
    897880        if (from->filename != NULL) 
    898881                to->filename = store_string(from->filename, strlen(from->filename) + 1 TSRMLS_CC); 
    899         if (from->doc_comment != NULL) 
    900                 to->doc_comment = store_string(from->doc_comment, from->doc_comment_len + 1 TSRMLS_CC); 
    901882 
    902883        store_zval_hash(&to->constants_table, &from->constants_table); 
  • eaccelerator/trunk/eaccelerator.h

    r195 r205  
    217217        zend_uint line_start; 
    218218        zend_uint line_end; 
    219         char *doc_comment; 
    220         zend_uint doc_comment_len; 
    221219#endif 
    222220} eaccelerator_op_array; 
     
    243241        zend_uint line_start; 
    244242        zend_uint line_end; 
    245         char *doc_comment; 
    246         zend_uint doc_comment_len; 
    247243#endif 
    248244} eaccelerator_class_entry;