Mojo function
keep
keep[Type: AnyType, origin: ImmutOrigin, //](ref [origin] val: Type)
Provides a hint to the compiler to not optimize the variable use away.
This is useful in benchmarking to avoid the compiler not deleting the code to be benchmarked because the variable is not used in a side-effecting manner.
Parameters:
- โType (
AnyType): The type of the input. - โorigin (
ImmutOrigin): The origin of the input.
Args:
- โval (
Type): The value to not optimize away.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!