Jump to content
  • Advertisement
Sign in to follow this  
Raptisoft

Safety of distributing bytecode...

This topic is 2525 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, if I precompile Angelscript code... how safe would it be to distribute that bytecode for multiple systems?

I.E. if I compiled the script on Windows, could I use the resulting bytecode on iPhone? Does it take into account all the new floating point alignment stuff, and whatnot, on those other processors?

What I mean specifically is, I was recently nailed on iOS because I was casting a float into a char array to get data-- like:


*ptr=charArray[103]; // Where a float is embedded in the char array
float theValue=(float*)ptr; // Used to work, until iOS 5, when they implemented FP alignment

float theValue;
memcpy(&theValue,ptr,sizeof(float)); // New way I have to do it

Share this post


Link to post
Share on other sites
Advertisement
Manual: Pre-compiled byte code

The byte code is not quite platform independent yet. There are still a few things that I need to change to accomplish that, e.g. adjusting the code according to the size of pointers, and platform alignment requirements. I'm hoping to be able to complete the implementation of a truly platform independent bytecode in the next couple of releases.

That said I do believe bytecode compiled on a 32bit system (independently of the OS) should be compatible with iOS which is also 32bit, as far as I know. The pre-compiled bytecode is independent of the endianess of the CPU, and possible differences in size of registered objects or offsets of object properties are also taken care of. There might be specific alignment issues that I'm not aware of, but these would most likely be there even for code compiled on iOS too.

Please let me know if you encounter any problems so I can have them fixed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!