Closed Monniasza closed 3 years ago
Yepp, those will come with JOML 2.0 once Valhalla with value/inline types becomes a thing. Due to the non-deterministic allocation/inline/escape/stack-replacement behaviour of the JIT, the design choice for JOML's types was: you allocate yourself when you know you need to and JOML mutates existing instances, provided by you. This will change with JOML 2.0 and Valhalla.
These can be still done as references. I'd intend to use them as map keys.
There are already read-only/constant interfaces/views with which you can achieve this. See e.g. Vector3dc
.
And when you want to avoid other code mutating the same instance, then simply never share instances: Whenever you give an instance away to some other code, simply make a new copy of that instance.
I'd like to have immutable versions of all types in this library. The new types would have 'const' appended to names of current types Example:
Vector3d
->Vector3dconst
. THey would share common interface