文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>allocate mem for perl hash

allocate mem for perl hash

时间:2007-05-21  来源:digex

As an lvalue keys() allows you to increase the number of hash buckets allocated for the given hash. This can gain you a measure of efficiency if you know the hash is going to get big. (This is similar to pre-extending an array by assigning a larger number to $#array.) If you say

 keys %hash = 200;

then %hash will have at least 200 buckets allocated for it--256 of them, in fact, since it rounds up to the next power of two. These buckets will be retained even if you do %hash = (), use undef %hash if you want to free the storage while %hash is still in scope. You can't shrink the number of buckets allocated for the hash using keys() in this way (but you needn't worry about doing this by accident, as trying has no effect).

相关阅读 更多 +
排行榜 更多 +
枪战特训2

枪战特训2

飞行射击 下载
打击者19452代最新版

打击者19452代最新版

飞行射击 下载
合金弹头x最新版

合金弹头x最新版

飞行射击 下载