PDA

View Full Version : Recursion


TracerX
27/07/2017, 11:42 PM
hello I've been facing a problem on my 39k~ line code, there's a recursion, I read that a recursion means a function calling itself in the same function, like this:
FunctionX()
{
//Some code
FunctionX();
return 1;
}
well, I checked the code I added recently but I couldnt find smth similar so I was wondering if it could happen because of something else? I noticed that it lags my server as fuck. And if it is only because the function repeating itself, is there a way to find which function causes it? like any plugin or anything? Help would be really appreciated.

Pottus
27/07/2017, 11:45 PM
Profiler plugin http://forum.sa-mp.com/showthread.php?t=271129

OneDay
28/07/2017, 09:16 AM
hello I've been facing a problem on my 39k~ line code, there's a recursion

why is that problem?

TracerX
29/07/2017, 02:08 AM
Profiler plugin http://forum.sa-mp.com/showthread.php?t=271129
how do I use it? I added profile_gamemode 1 in m server.cfg and used the include/plugin, nothing gets printed.
why is that problem?
I believe it lags my server

Logic_
29/07/2017, 07:44 AM
Possibly can, and works way too similarly to an infinite loop. What else can you expect? Might showing why and how are you using that function?

iLearner
29/07/2017, 08:50 AM
If you're using new compiler (the fast one) you need to put #pragma disable recursion under #include <a_samp>

TracerX
29/07/2017, 11:09 PM
Possibly can, and works way too similarly to an infinite loop. What else can you expect? Might showing why and how are you using that function?

if I knew which function causes it, I'd have fixed it..