Generally speaking, most non-local variables would be fetched again as the compiler needs to be conservative with any non-inline calls. So caching is desirable.
But this is particularly designed around the case of GImPlot being re-defined to be a thread_local variable, in which case the fetches triggers a little more platform-dependent machinery.
(PS: Aside from this, I would like to work on a mechanism for dear imgui to allow storing per-extension context pointers inside the main dear imgui context. I'll let you know if that happens.)
Generally speaking, most non-local variables would be fetched again as the compiler needs to be conservative with any non-inline calls. So caching is desirable. But this is particularly designed around the case of
GImPlot
being re-defined to be a thread_local variable, in which case the fetches triggers a little more platform-dependent machinery.(PS: Aside from this, I would like to work on a mechanism for dear imgui to allow storing per-extension context pointers inside the main dear imgui context. I'll let you know if that happens.)