Currently we’re working on our first ECS/DOTS project and we’re still in the research phase. One thing we noticed when making use of the NativeHastSet, is that whenever we try to use a lower initial capacity than 256, it will still create a new NativeHastSet with a capacity of 256 rather than our input. Whenever we create a NativeHastSet with a larger capacity, say 1024, it will correctly set the capacity to the parameter value. See the image below.
Does anyone know if this is done on purpose, or is it a bug? In our case we wanted to set the value to 4, since the NativeHasSet is in a deterministic lockstep system, and therefore gets a lot of calls, so we want to minimize the memory usage. But we’re unsure if this is a bug in NativeHastSet or if this is done on purpose. In the documentation it says no such thing as a minimum value of 256.