From: Panayotis K. <pan...@pa...> - 2010-12-17 08:29:26
|
On Dec 17, 2010, at 2:19 AM, Arno Puder wrote: > > I agree in principle with your proposed first solution. However, there > are also instances where it is not necessary to copy the array (e.g., > the dex:fill-array instruction). I would suggest to add another boolean > parameter to that method that states if 'data' should be copied or not > and then go through the code and decide individually where the data > needs to be copied or not. If we can avoid unnecessary copying, we should. > > Arno You mean this one? dex:filled-new-array|dex:filled-new-array-range in line 3500 of xmlvm2objc.xsl I am not at all experienced with dex, and I have a question! From my understanding this is the only location where createSingleDimensionWithType...andData is called from the ObjC backend. And there is only one more, called by NSData. So, should I replace this generic call of the function with a new one, passing "copyData:NO" for the dex instruction and "copyData:Yes" for NSData ? I am trying to understand the memory management of the produced dex instruction. Why is no copying of data required at that point? |