-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
Recent changes have optimized allocation requests where the contents of a newly allocated memory region are immediately overwritten by data coming from an external source.
While these optimizations work well in practice, some of the API points which enable these optimizations are not too general. While it is possible, for example, to copy _an entire_ Java array into a newly allocated memory segment, it is not possible to copy a byte buffer, or another segment, or a slice of a Java array.
This leads to a tension, as clients have to fallback to a more general allocation request (one that doesn't provide initialization) which will then incur in a performance penalty (due to memory zeroing).
While these optimizations work well in practice, some of the API points which enable these optimizations are not too general. While it is possible, for example, to copy _an entire_ Java array into a newly allocated memory segment, it is not possible to copy a byte buffer, or another segment, or a slice of a Java array.
This leads to a tension, as clients have to fallback to a more general allocation request (one that doesn't provide initialization) which will then incur in a performance penalty (due to memory zeroing).