W3cubDocs

/Pony

DoNotOptimise

[Source]

Contains functions preventing some compiler optimisations, namely dead code removal. This is useful for benchmarking purposes.

primitive val DoNotOptimise

Constructors

create

[Source]

new val create()
: DoNotOptimise val^

Returns

Public Functions

apply[A: A]

[Source]

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

observe

[Source]

Prevent the compiler from optimising out writes to an object marked by the apply function.

fun box observe()
: None val

Returns

eq

[Source]

fun box eq(
  that: DoNotOptimise val)
: Bool val

Parameters

Returns

ne

[Source]

fun box ne(
  that: DoNotOptimise val)
: Bool val

Parameters

Returns

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/builtin-DoNotOptimise