Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Safety of distributing bytecode...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Raptisoft   Members   -  Reputation: 171

Like
0Likes
Like

Posted 12 January 2012 - 06:34 AM

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


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3227

Like
0Likes
Like

Posted 12 January 2012 - 03:41 PM

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.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS