PDA

View Full Version : COFFEE | limited amount of memory?


tcastudios
08-12-2006, 09:01 PM
I need to ask because I get a mysterious COFFEE error (14) Stack overflow.

In principe I have a coffee code in three blocks in one cof file (or COFFEE TAG, no difference).
One that gets information from the scene , works fine.
Second that use that information to stear an object, works fine
And a third block that stears about 25 other objects.

The problem is, all work fine using any two of the blocks.
I can activate any few lines in the third block and it also works.

I need block one, but can use either block 2 or 3 as well and there are no errors.

What I wonder, is there a limit of lines that COFFEE can use?
The complete code is 2100 lines.

Cheers
Lennart

JDP
08-12-2006, 11:40 PM
Hi Lennart,
are you using a recursive function, is it possible that there is infinite recursion happening , or are you using very large arrays, it is possible that this could cause this sort of error. Basically the stack is a region of memory on which local automatic variables (the variables in the scope of your functions) are created and function arguments are passed. The stack is allocated a certain size in memory and if your function needs more space on the stack than it has been allocated it will overflow causing errors. Have a read of this to understand how the call stack works http://en.wikipedia.org/wiki/Call_stack (http://en.wikipedia.org/wiki/Call_stack). Sorry I can't tell you what the limit would be, best to ask at plugin cafe.

cheers,
JDP

tcastudios
08-13-2006, 12:05 AM
Hi JDP. Thanks for the link. I've put the question at Plugin Cafe as well.
The code is a "one way flow" pretty much except for a regular searchmy Tag class at the top before execute(or Main in a coffe tag).
There is however loads of variables and 100+ userdata sliders (on the tags)
It's only the first tag that has the running code, the rest only carries userdata sliders.

I do suspect that the stack gets filled.
By only using the first two code "blocks" (those are the main plugin function and work fine)and then adding "unrelated" code such as;

var obj1 = doc->FindObject("object1");
var obj2 = doc->FindObject("object2") etc
I get the Stack overflow after some 8 extra lines.

Adding
println("hey there"); several times is no problem.

We'll see what the response at the Cafe might be.

Cheers
Lennart

CGTalk Moderation
08-13-2006, 12:05 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.