第一个版本可以生成两个完整的数组副本,而第二个版本则完全没有复制数组。
The first version might cause two full copies of the array, whereas the second causes no copying at all.
当把数组名用作参数时,传递给函数的值是数组起始元素的位置或地址——它并不复制数组元素本身。
When the name of an array is used as an argument, the value passed to the function is the location or address of the beginning of the array - there is no copying of array elements.
通过使用这些方法访问较大的数组,您可以确保只复制本机代码将要实际使用的数组部分。
By using these methods to access larger arrays, you can ensure that you copy only the region of the array that the native will actually use.
应用推荐