The scala.MbArray class is an alternative implementation of the scala.Array class
that does not require a scala.reflect.ClassTag to be instantiated. On the other hand,
the locality and unboxing guarantees are still valid when used with the miniboxing
plugin. For example:
class C[@miniboxed T] {
val mb: MbArray[T] = MbArray.empty(100)
}
If the instatiation is done outside miniboxed code or cannot be optimized, the miniboxing
plugin will warn (don't forget to add the -P:minibox:warn flag to your build!)
**Avoid the warnings at your own risk: You will lose the locality and unboxing guarantees!**
The
scala.MbArray
class is an alternative implementation of thescala.Array
class that does not require ascala.reflect.ClassTag
to be instantiated. On the other hand, the locality and unboxing guarantees are still valid when used with the miniboxing plugin. For example:class C[@miniboxed T] { val mb: MbArray[T] = MbArray.empty(100) }
If the instatiation is done outside miniboxed code or cannot be optimized, the miniboxing plugin will warn (don't forget to add the
-P:minibox:warn
flag to your build!) **Avoid the warnings at your own risk: You will lose the locality and unboxing guarantees!**