cvs: php-src(PHP_5_3) /ext/phar tar.c
| From: | Greg Beaver | Date: | Mon, 16 Jun 2008 04:09:20 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/phar tar.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-50449@lists.php.net to get a copy of this message | ||
cellog Mon Jun 16 04:09:20 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar tar.c
Log:
fix hashtable creation for tar to be estimated size needed
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/tar.c?r1=1.55.2.9&r2=1.55.2.10&diff_format=u
Index: php-src/ext/phar/tar.c
diff -u php-src/ext/phar/tar.c:1.55.2.9 php-src/ext/phar/tar.c:1.55.2.10
--- php-src/ext/phar/tar.c:1.55.2.9 Sun Jun 15 21:42:20 2008
+++ php-src/ext/phar/tar.c Mon Jun 16 04:09:20 2008
@@ -216,11 +216,12 @@
myphar = (phar_archive_data *) pecalloc(1, sizeof(phar_archive_data), PHAR_G(persist));
myphar->is_persistent = PHAR_G(persist);
- zend_hash_init(&myphar->manifest, sizeof(phar_entry_info),
+ /* estimate number of entries, can't be certain with tar files */
+ zend_hash_init(&myphar->manifest, 2 + (totalsize >> 12),
zend_get_hash_value, destroy_phar_manifest_entry, myphar->is_persistent);
- zend_hash_init(&myphar->mounted_dirs, sizeof(char *),
+ zend_hash_init(&myphar->mounted_dirs, 5,
zend_get_hash_value, NULL, myphar->is_persistent);
- zend_hash_init(&myphar->virtual_dirs, sizeof(char *),
+ zend_hash_init(&myphar->virtual_dirs, 4 + (totalsize >> 11),
zend_get_hash_value, NULL, myphar->is_persistent);
myphar->is_tar = 1;
/* remember whether this entire phar was compressed with gz/bzip2 */