Sign in to follow this  
loboWu

imported function error

Recommended Posts

loboWu    214
Hi:
I create my private angelscript compiler (like the asBuild),
But it could recursively compile files in directorys.

After upgrading from 2.17.0 to 2.20.3, my compiler raise a new exception.
Which is the engine->importedFunctions index overflow.

The probloem is that, In angelscript, all imported functions will accumulate until engine destroy.
But my compiler will process 2~4 thounds file, which will cause the imported function index overflow(>0xFFFF).

I change a line in
void asCModule::InternalReset()
{
....
// Free bind information
for( n = 0; n < bindInformations.GetLength(); n++ )
{
[color="#ff0000"]engine->importedFunctions.RemoveIndex(bindInformations[n]->importedFunctionSignature->id & 0xFFFF);[/color]
// engine->importedFunctions[bindInformations[n]->importedFunctionSignature->id & 0xFFFF] = 0 ;

asDELETE(bindInformations[n]->importedFunctionSignature, asCScriptFunction);
asDELETE(bindInformations[n], sBindInfo);
}
....
}

And everything is OK.

But I amn't sure that if there is a side effect.

Thanks a lot.


Share this post


Link to post
Share on other sites
WitchLord    4678
Ooh, what kind of project are you working on that has these many script files to compile? Looks like I'm missing some cleanup code for the importedFunction array. You're on the right track, but I'll verify if this is all that is necessary.

Share this post


Link to post
Share on other sites
loboWu    214
[quote name='WitchLord' timestamp='1307461492' post='4820556']
Ooh, what kind of project are you working on that has these many script files to compile? Looks like I'm missing some cleanup code for the importedFunction array. You're on the right track, but I'll verify if this is all that is necessary.
[/quote]

Thanks for your help.
I use your angelscript to develop private SDK.
Twenty RDs use this SDK to implement factory testing.
Actually , the total amount of angelscript in my project maybe 0.2 million.

Share this post


Link to post
Share on other sites
WitchLord    4678
Indeed. Wow. :D

I would be interested in seeing some profiling on the AngelScript compiler from that project. Would it be possible for you to provide that? I'm pretty sure there is very much that can be optimized in the compiler. I haven't put in much effort in making the compiler as fast as possible, as usually the scripts are quite small. But with this many scripts your application is probably spending quite a bit of time in the compiler.

Share this post


Link to post
Share on other sites
loboWu    214
[quote name='WitchLord' timestamp='1307757715' post='4821943']
Indeed. Wow. :D

I would be interested in seeing some profiling on the AngelScript compiler from that project. Would it be possible for you to provide that? I'm pretty sure there is very much that can be optimized in the compiler. I haven't put in much effort in making the compiler as fast as possible, as usually the scripts are quite small. But with this many scripts your application is probably spending quite a bit of time in the compiler.
[/quote]

Yes, I had do a bit optimization about preprocessor(it is base on angeljuice [url="http://www.anticore.org/juce/angeljuice/"]http://www.anticore.org/juce/angeljuice/[/url])
But my compiler had binding with my library like a tight knot.
I will try to split that.

Thanks.

Share this post


Link to post
Share on other sites
loboWu    214
[quote name='WitchLord' timestamp='1307762840' post='4821969']
I've fixed this bug now. You can get the fix in the SVN revision 896.


Thanks,

Andreas
[/quote]

Dear Andreas:
I had been check the latest revision.
Yes, it had fix the imported function index,
but there is a new bug.
try this:

void name(uint8 a)
{
}

void main()
{
uint8[] name={1,2,3,4,5};
uint8 tmp;
name[1]=10;
name(tmp); //no matching signatures
}

if local variable name and the function name is ambiguous,
the compiler will report no matching signatures.

lobo

Share this post


Link to post
Share on other sites
WitchLord    4678
I've improved the error message for this scenario in revision 901.

Now the script would give the more appropriate error message [color="#000000"]"[size="2"][size="2"]Expression doesn't form a function call. 'name' is a variable of a non-function type"[/size][/size][/color]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this