summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-12-13 07:28:45 +0000
committerXuefer <xuefer@gmail.com>2013-12-13 07:28:45 +0000
commit7b4722df0fad260ff6a66b229cf4276ccd3a5e3e (patch)
tree2337ad5b3fd068c5e5daa9bc61a8d2ad133e3b5c
parent501bbf2e0f5ac94e6d1f3f430833353a78081add (diff)
downloadxcache-7b4722df0fad260ff6a66b229cf4276ccd3a5e3e.tar.gz
xcache-7b4722df0fad260ff6a66b229cf4276ccd3a5e3e.zip
fixed #333: reduce memory usage for small or empty files
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1478 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
-rw-r--r--ChangeLog6
-rw-r--r--NEWS6
-rw-r--r--mod_cacher/xc_cacher.c6
-rw-r--r--processor/processor.m414
4 files changed, 18 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 83505cb..9952755 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,12 @@ ChangeLog
* misc:
* Reflection info added for APIs
+3.2.0 2013-??-??
+ChangeLog
+========
+ * cacher:
+ * fixed #333: reduce memory usage for small or empty files
+
3.1.1 2013-??-??
ChangeLog
========
diff --git a/NEWS b/NEWS
index 0702dde..874eca8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,12 @@
4.0.0 2014-??-??
-ChangeLog
-========
* api updates
* cache defragment, cache to disk
+3.2.1 2013-??-??
+========
+
3.1.1 2013-??-??
+========
* compatible with bcompiler
3.1.0 2013-10-10
diff --git a/mod_cacher/xc_cacher.c b/mod_cacher/xc_cacher.c
index 2e50532..06b489c 100644
--- a/mod_cacher/xc_cacher.c
+++ b/mod_cacher/xc_cacher.c
@@ -866,11 +866,6 @@ static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php TSRMLS_DC) /* {
CG(zend_lineno) = 0;
#endif
- i = 1;
-#ifndef ZEND_ENGINE_2_2
- zend_hash_add(&EG(included_files), entry_php->entry.name.str.val, entry_php->entry.name.str.len+1, (void *)&i, sizeof(int), NULL);
-#endif
-
#ifndef ZEND_ENGINE_2
xc_free_alloca(new_cest_ptrs, use_heap);
#endif
@@ -2187,7 +2182,6 @@ static zend_op_array *xc_compile_file_cached(xc_compiler_t *compiler, zend_file_
/* found entry */
if (stored_entry && stored_php) {
- zend_llist_add_element(&CG(open_files), h);
return xc_compile_restore(stored_entry, stored_php TSRMLS_CC);
}
diff --git a/processor/processor.m4 b/processor/processor.m4
index 9eaedb4..3f3e43b 100644
--- a/processor/processor.m4
+++ b/processor/processor.m4
@@ -749,22 +749,24 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
/* deep */
STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
#ifdef ZEND_ENGINE_2
- STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
- gc_arg_info = 1;
+ if (SRC(`arg_info')) {
+ gc_arg_info = 1;
+ STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
+ }
#endif
DST(`filename') = processor->entry_php_src->filepath;
+
#ifdef ZEND_ENGINE_2_4
- if (SRC(`literals')) {
+ if (SRC(`literals') && op_array_info->literalinfo_cnt) {
gc_opcodes = 1;
- if (op_array_info->literalinfo_cnt) {
- gc_literals = 1;
- }
+ gc_literals = 1;
}
#else
if (op_array_info->oplineinfo_cnt) {
gc_opcodes = 1;
}
#endif
+
#ifdef ZEND_ENGINE_2_4
if (gc_literals) {
dnl used when copying opcodes