summaryrefslogtreecommitdiff
path: root/ext/phar/phar_internal.h
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-06-15 21:42:20 +0000
committerGreg Beaver <cellog@php.net>2008-06-15 21:42:20 +0000
commit4104786072fe60f0a3ee7b9eac504cacdad9304d (patch)
treee3b1cbacc3260ae388ac8cc06140294e2a9b5bd4 /ext/phar/phar_internal.h
parentd8ed660a02460954efe2e9d6aff8bef72a182ae9 (diff)
downloadphp-git-4104786072fe60f0a3ee7b9eac504cacdad9304d.tar.gz
another optimization - move inode hash to initial manifest parsing, improves runtime perf of stat slightly
Diffstat (limited to 'ext/phar/phar_internal.h')
-rwxr-xr-xext/phar/phar_internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h
index 3d771f2393..85a2b8551c 100755
--- a/ext/phar/phar_internal.h
+++ b/ext/phar/phar_internal.h
@@ -268,6 +268,8 @@ typedef struct _phar_entry_info {
int is_zip:1;
/* for cached phar entries */
int is_persistent:1;
+ /* for stat */
+ unsigned short inode;
} phar_entry_info;
/* information about a phar file (the archive itself) */
@@ -408,6 +410,17 @@ static inline int phar_validate_alias(const char *alias, int alias_len) /* {{{ *
}
/* }}} */
+static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
+{
+ char tmp[MAXPATHLEN];
+ int tmp_len;
+
+ tmp_len = entry->filename_len + entry->phar->fname_len;
+ memcpy(tmp, entry->phar->fname, entry->phar->fname_len);
+ memcpy(tmp + entry->phar->fname_len, entry->filename, entry->filename_len);
+ entry->inode = (unsigned short)zend_get_hash_value(tmp, tmp_len);
+}
+/* }}} */
void phar_request_initialize(TSRMLS_D);