3 ms·
I always thought array elements were contiguous in memory? Is it that the objects are contiguous, but the pointers are not? If so, this does seem pretty expens
by dajohnson89 7y ago
I always thought array elements were contiguous in memory? Is it that the objects are contiguous, but the pointers are not? If so, this does seem pretty expensive and I wonder if there's any workarounds.
- touisteur 7y agoWell arrays if elementary types are contiguous, yes. Arrays of objects are arrays of references to instances. The references are contiguous, but they point to instances all over the place.
- dajohnson89 7y agothat makes perfect sense, thank you