Give Your .NET Object A Shot Of Lifeline [Tutorial]

Written by anand-gupta | Published 2020/08/03
Tech Story Tags: technology | tutorial | dotnet | eager-root-collection | using-api-in-dotnet | extend-lifeline-in-dotnet | programming | dotnet-tutorial

TLDR In this post, we will see an example of a scenario where we may want to extend the lifetime of an object. We will look at how we can accomplish this in two ways — one is writing an API ourselves (in the spirit of learning by doing) and other is to use existing API in.NET. The Lifeline.KeepAlive() method has absolutely no code in it. The key feature of this method is the attribute on the method [MethodImpl(MethodImplOptions.NoInlining) This guarantees the JIT will never try to inline this method.via the TL;DR App

no story

Written by anand-gupta | Passionate Techie, Binge Watcher, Globe trotter
Published by HackerNoon on 2020/08/03