DoNotOptimise [Src]
Contains functions preventing some compiler optimisations, namely dead code removal. This is useful for benchmarking purposes.
primitive val DoNotOptimise
Constructors
create [Src]
new val create()
: DoNotOptimise val^
Returns
- DoNotOptimise val^
Public Functions
apply [Src] [A: A]
Prevent the compiler from optimising out obj and any computation it is derived from. This doesn't prevent constant propagation.
fun box apply[A: A](
obj: A)
: None val
Parameters
- obj: A
Returns
- None val
observe [Src]
Prevent the compiler from optimising out writes to an object marked by the apply function.
fun box observe()
: None val
Returns
- None val
eq [Src]
fun box eq(
that: DoNotOptimise val)
: Bool val
Parameters
- that: DoNotOptimise val
Returns
- Bool val
ne [Src]
fun box ne(
that: DoNotOptimise val)
: Bool val
Parameters
- that: DoNotOptimise val
Returns
- Bool val