Advertisement

When to use asOBJ_APP_CLASS_ALLINTS

Started by December 09, 2013 11:05 AM
2 comments, last by WitchLord 7 years, 4 months ago

I read this post and it mentions the AMD64 ABI: http://www.gamedev.net/topic/614684-asobj-app-class-allints/

Does that mean that there's no benefit to using asOBJ_APP_CLASS_ALLINTS/FLOATS if you're targetting e.g. 32-bit Intel? I couldn't find anything in the documentation (besides the listing in the enum) as far as guidance for this thing's use.

Thank you

The flags asOBJ_APP_CLASS_ALLINTS/FLOATS are used to tell AngelScript what the type of content the object has, so AngelScript can decide how the object should be passed to registered functions in native calling conventions. The only ABI so far that needs these flags is the AMD/Intel 64bit ABI that the g++ compiler uses. This specific ABI can decide to put the object in the CPU float registers or general registers depending on the type of the members of the class.

On any other platform or compiler the flags will have no effect.

The documentation that describes when/how to use these flags is here:

Manual: Value types and native calling convention

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Yes, pointers are treated by the compilers as pure POD types, same as integers. If you intend to register a pointer as a type, then you should use the flag asOBJ_APP_PRIMITIVE.

I believe how an empty struct like this is treated is compiler specific. I would guess that the flags asOBJ_APP_CLASS | asOBJ_APP_CLASS_ALLINTS should be used, but only by testing it can you be certain. It is possible that the compiler treats this type like a primitive too, in which case asOBJ_APP_PRIMITIVE should be used instead.

 

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement