Repository navigation
|
FRENewByteArray makes a FREObject out of a FREByteArray, which has a bytes and a length field. My question is, does FRENewByteArray make a copy of bytes, or does the Flash Runtime free the original memory? |
Answered by
ajwfrost
Nov 25, 2026
Replies: 2 comments 3 replies
|
Hi The FRENewByteArray method will make a copy of the data. Essentially it creates the AS3 ByteArray object, then sets its length based on the passed-in object - which will do the memory allocation. And then it gets the writable buffer and does a memory copy from the passed-in data to the new AS3 object. thanks |
3 replies
Answer selected by
Fancy2209
|
This issue has been noted in AIR SDK 51.5.1.2 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
The FRENewByteArray method will make a copy of the data. Essentially it creates the AS3 ByteArray object, then sets its length based on the passed-in object - which will do the memory allocation. And then it gets the writable buffer and does a memory copy from the passed-in data to the new AS3 object.
thanks