unknown, due to recursion
#1

What does this mean
Код:
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
It should show how many cells I use, but it doesn't. It says unknown due to recursion. What does it mean ?
Reply
#2

Bump -.- .
Reply
#3

I believe when something like that shows on the compiler that it means your string sizes are too large. So when you have things like:
pawn Код:
new string[500];
for something like
pawn Код:
format(string, sizeof(string), "Welcome, %s(%d)", pName, playerid);
then you really don't need such a large string size. Make sense?
Reply
#4

This is an example for recursion:

pawn Код:
Recursion(number)
{
    new next_number = number + 1;
    Recursion(next_number);
}

// Will be executed like this
Recursion(number)
{
    new next_number = number + 1;
    {
        new next_number_2 = next_number + 1;
        {
            new next_number_3 = next_number_2 + 1;
            {
                //...
            }
        }
    }
}
As you see, the function calls itself - in this case for ever. So the compiler does not know, how much ram this will need, as there are new variables in every call, and the old ones do not get deleted.
Recursions itself are a nice scripting method, as long as you use them correctly and end them at some point. So the compiler message does not have to be bad.

Check your script for a function that calls itself, and you got the reason for that message.
Reply
#5

All my strings are lower than 128, so I need to optimize my GM actually ?
Reply
#6

Take a look at this thread: Code Optimization
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)