diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-09-17 10:39:27 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-09-17 10:39:27 +0000 |
commit | 0a4986294ec50ec8a4a4a257f636963fe57ca322 (patch) | |
tree | a06d6ce9c9e6ecf299d910ce5e4ef4bc8e1ea8aa /cop.h | |
parent | 022eaa24f0f108e678e18c854c6eb92c735188c5 (diff) | |
download | perl-0a4986294ec50ec8a4a4a257f636963fe57ca322.tar.gz |
Some notes about struct block_loop
p4raw-id: //depot/perl@28859
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -404,11 +404,28 @@ struct block_loop { SV ** itervar; #endif SV * itersave; + /* (from inspection of source code) for a .. range of strings this is the + current string. */ SV * iterlval; + /* (from inspection of source code) for a foreach loop this is the array + being iterated over. For a .. range of numbers it's the current value. + A check is often made on the SvTYPE of iterary to determine whether + we are iterating over an array or a range. (numbers or strings) */ AV * iterary; IV iterix; + /* (from inspection of source code) for a .. range of numbers this is the + maximum value. */ IV itermax; }; +/* It might be possible to squeeze this structure further. As best I can tell + itermax and iterlval are never used at the same time, so it might be possible + to make them into a union. However, I'm not confident that there are enough + flag bits/NULLable pointers in this structure alone to encode which is + active. There is, however, U8 of space free in struct block, which could be + used. Right now it may not be worth squeezing this structure further, as it's + the largest part of struct block, and currently struct block is 64 bytes on + an ILP32 system, which will give good cache alignment. +*/ #ifdef USE_ITHREADS # define CxITERVAR(c) \ |