Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Per-translation-unit variable indexing

Open ForNeVeR opened this issue 5 months ago • 2 comments

Originally posted by @ForNeVeR in https://github.com/ForNeVeR/Cesium/pull/617#discussion_r1740190291

Currently, we have a global static counter, CurrentIndex in the Cesium.CodeGen.Contexts.VariableInfo record.

https://github.com/ForNeVeR/Cesium/blob/f1b5204e9d1f0869ed8c4ee0caf3c3e41ad6a5a9/Cesium.CodeGen/Contexts/VariableInfo.cs#L7-L11

I'd like to have some sort of indexing that's tied to the translation unit.

Such a counter is too error-prone: it will easily overflow on 2 billion variables constructed in a single compilation session. Moreover, this construct makes it impossible to copy a VariableInfo.

ForNeVeR avatar Sep 01 '24 21:09 ForNeVeR