We use cookies on this site to enhance your user experience
By clicking the Accept button, you agree to us doing so. More info on our cookie policy
We use cookies on this site to enhance your user experience
By clicking the Accept button, you agree to us doing so. More info on our cookie policy
Mojo compiler copies the body of this function to body of the function where its being called. This avoids performance costs associated with function calls, but it increases binary size.
@always_inline('nodebug')
Same as above but without debug info, debugger cannot step into this function when debugging, should be used with low level code.
Generates boilerplate lifecycle methods. __init__
, __copyinit__
, __moveinit__
,__del__
All the arguments and variables of this decorator should adhere to types that should be passed in machine registers (like CPU registers). This mean all these types should always be passed by value and cannot be passed by reference. These structs cannot hold values that are not register passable.
Types:
__init__
, __copyinit__
, __del__
and no move.__init__
not mandatory, other are only defined by compiler.Int
, Bool
, Float64
etc.Though closure function contains dynamic values from outer loop, it can still be accessed as parameter.
@__copy_capture(variable_name)
Passed on top of parameter closure to capture register passable values by copy. This copies the mentioned variable in to closure function by value rather capturing it by reference. This avoids any lifetime concerns regarding that variable.
Latest Posts