[Vm-dev] Issue 96 in cog: Using >> (bitShift:) instead of pow (raisedTo:)

cog at googlecode.com cog at googlecode.com
Sun Sep 2 18:56:40 UTC 2012


Status: Accepted
Owner: nicolas.... at gmail.com
Labels: Type-Enhancement Priority-Low

New issue 96 by nicolas.... at gmail.com: Using >> (bitShift:) instead of pow  
(raisedTo:)
http://code.google.com/p/cog/issues/detail?id=96

By virtue of SLANG translation, interpreterAllocationReserveBytes uses  
pow((double)2,(double)n) to answer an int, wouldn't it better to just use a  
bit shift?

2^n <=> 1<<n, up to n=31
I doubt we reserve more than that, the result is signed anyway.

And this would remove yet another warning.

Attachments:
	interpreterAllocationReserveBytes.st  2.0 KB



More information about the Vm-dev mailing list