If I return from inside a memScoped lambda, does that leak anything I’ve allocated? I would assume that return@memScoped would work fine, but I’m not sure about returning from the function.
t
Tijl
04/01/2022, 7:58 AM
it uses
finally
so how you return should not matter
l
Landry Norris
04/01/2022, 1:52 PM
Thanks. I assumed there would be something in place, but it's good to know for sure that I'm not leaking memory by returning early from the lambda.
t
Tijl
04/01/2022, 1:54 PM
the docs have a source link that can helpful in a case like this