Tail pad optimization, cache friendlyness and C++ interrop

via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 18 13:03:07 PDT 2014


On Wednesday, 18 June 2014 at 19:17:50 UTC, Marc Schütz wrote:
> Jumps and loops don't matter. The point is that such a program 
> only has a finite amount of possible states: The 4 bytes of 
> RAM, plus the current instruction pointer (to be 2 bits for 4 
> instructions). In this case, there are only
>
>     2^(4*8) * 2^2 = 2^34 = 17179869184
>
> different states. If during execution you encounter a state 
> that you've already seen before, you know that the program will 
> go into an infinite loop. This is easy to implement using a 
> bitmap.
>
> Of course, said bitmap will soon become too large to handle in 
> practice if you want to analyze realistic "interesting" 
> programs.

Ah, right, my bad :-)


More information about the Digitalmars-d mailing list