[Pharo-project] latest build yields stack trace running #cleanUpForProduction
henrik.s.johansen at veloxit.no
Wed Jan 18 06:49:45 EST 2012
On Jan 18, 2012, at 12:44 58PM, Mariano Martinez Peck wrote:
> On Wed, Jan 18, 2012 at 12:25 PM, Henrik Johansen <henrik.s.johansen at veloxit.no> wrote:
> On Jan 18, 2012, at 12:14 47PM, Mariano Martinez Peck wrote:
> > Well....it seems I found the problem. And in fact, it has alredy been solved by Levente in Squeak...I waste so many hours...and the fix was there..
> > So, can you try changing to
> > sizeFor: numberOfElements
> > "Return the minimum capacity of a dictionary that can hold numberOfElements elements. At least 25% of the array must be empty and the return value must be a power of 2."
> > ^(numberOfElements * 4 // 3) asLargerPowerOfTwo max: 1
> > And see if it works? it works here…
> It should not be necessary.
> The real bug is that Integer >> isPowerOfTwo does not check for the edge case:
> 0 isPowerOfTwo true
> A small fix:
> Integer >> #isPowerOfTwo
> "Return true if the receiver is an integral power of two."
> ^ self ~= 0 and: [(self bitAnd: self-1) = 0]
> Indeed :)
> now...even if that's correct, do you think there could be side effect in other places?
Not any that won't merely magically start working the way you expect them to, like say (looking at the senders):
SmallInteger maxVal +1 numberOfDigitsInBase: 0
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev