Alignment requirements

Started by
29 comments, last by Starfox 10 years, 3 months ago

smile.png

The changes you've done so far seems to be fine.

Are you testing against the test_feature app in the svn? It's the best way to make sure you don't accidentally break anything.

Not really, I can't get the test harness to work on my system. We test internally but out test isn't as comprehensive. Would it be too much to ask you to test my patches? Sorry.

Holy crap I started a blog - http://unobvious.typepad.com/
Advertisement

Added support for aligned allocation: https://bitbucket.org/sherief/angelscript/commits/795cc7a762ea0f47455f489f1c0e0b2d71911c1e

Holy crap I started a blog - http://unobvious.typepad.com/

CScriptEngine's CallAlloc() and CallFree() now respect type alignment: https://bitbucket.org/sherief/angelscript/commits/dbbc0002748f02d1170540563c61d989834fcc0b

Holy crap I started a blog - http://unobvious.typepad.com/

Commits for aligned allocation support:

https://bitbucket.org/sherief/angelscript/commits/528c3644b335dbf0ff68963e180ef0c309b17f64

https://bitbucket.org/sherief/angelscript/commits/1f21185159ce5248f28fc1cc34b5c5098ee33738

Global property support for aligned allocation: https://bitbucket.org/sherief/angelscript/commits/269fd22c8e6f063690d3ab9643333142d7d1cdd7

Holy crap I started a blog - http://unobvious.typepad.com/

Type info defaults to 4-byte alignment: https://bitbucket.org/sherief/angelscript/commits/294090097bf181a93cc0a962991ea7ca6cbad427

Holy crap I started a blog - http://unobvious.typepad.com/

You seem to make progress quite quickly :)

I'll review the latest changes as soon as I can and let you know if I find anything in particular that needs to be changed.

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

You seem to make progress quite quickly smile.png

Necessity is the mother of all crunch periods.

Holy crap I started a blog - http://unobvious.typepad.com/

I'm trying to add aligned allocation support to asCCompiler::AllocateVariable() and I'm not sure exactly what the function does internally. Any clarification?

Also, is there any interest in merging these changes with the main AngelScript trunk? We'd love to have the feature officially supported but if there's no interest (and I'm not sure whether there is, seeing as how none of the patches were accepted) we could just do some internal hacks to get our code working and stick to that version.

Holy crap I started a blog - http://unobvious.typepad.com/

The AllocateVariable method is responsible for reserving the stackspace that will be used for the local variable. Primitives of the same size can share the same area as long as it is free since they do not have any special cleanup routines. Object types on the other hand cannot share the same space with variables of other types, as then the exception handler would have a much harder time to figure out what type of the object stored in the space is when doing the stack cleanup.

For your implementation you must change this method to make sure the space allocated will be aligned to the specified alignment boundary of the type.

Don't worry. I definitely have an interest to merge these changing into the AngelScript SVN. I will however wait until the feature is completed to a useable degree, as I don't know if you will finish all changes before I'm ready to release the next version of AS. The individual changes you've made so far don't add anything to the library except additional complexity to the code. Only once all the changes are ready will they provide value to the community.

I suggest you concentrate on making things work as far as you need it first. Feel free to use quick hacks if it makes it easier for you. Let me worry about making the changes work in a more generic way when I check in the changes. I always put in my own touches on the contributions I receive anyway. smile.png

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

Bug fix for allocation / deallocation mismatch: https://bitbucket.org/sherief/angelscript/commits/a99b390ee34dd441c5bda6338ca05bfd9f9e1c6f

Holy crap I started a blog - http://unobvious.typepad.com/

This topic is closed to new replies.

Advertisement