X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cop.h;h=effdbf34ae7f179fb4c9c16ec0c212ad76d6f32f;hb=0a4986294ec50ec8a4a4a257f636963fe57ca322;hp=66b7ffb41d289eb32ce8ef7ece237684f3b73ad4;hpb=022eaa24f0f108e678e18c854c6eb92c735188c5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/cop.h b/cop.h index 66b7ffb..effdbf3 100644 --- a/cop.h +++ b/cop.h @@ -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) \