On 02/01/2012 10:44 PM, Mark Roos wrote: > Hi Charles > > Its pretty simple. All of my integers are boxed and are by definition > immutable. However I noticed > that many uses of integer were for loop counters and indexes where the > integer never escapes from > the method. So I added two primitives, one to copy a integer into a > new box and the other to increment > the java primitive held inside the box. In all other ways it inherits > from my Integer class. The value is in > reducing Integer creation for big loop/index ints. > > Usage looks like > position := 1 newMutable. gets a mutable integer with an > initial value of 1 > position increment:1. increments the internal > primitive > position <= 100000 normal integer compare method > > I'll probably add a mutable bit to the header to protect the unwary in > case it escapes but for now its > a power tool. > > regards > mark
if you know it will never escape,you should use an int directly. Rémi _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev