4 ms·
99% of the time, the calling code trivially owns the array. If you are in a situation where the compiler cannot figure that out, then you need to deal with it r
by gizmo686 3y ago
99% of the time, the calling code trivially owns the array. If you are in a situation where the compiler cannot figure that out, then you need to deal with it regardless of what String does, because the exact same problem exists by the caller itself having a reference to the object.
- j16sdiz 3y agoJava compiler have a (not too bad) escape analysis engine. For something as low level as String intern/optimisation, it can be done in compile time