Recursion
#1

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:
pawn Код:
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.
Reply
#2

Profiler plugin https://sampforum.blast.hk/showthread.php?tid=271129
Reply
#3

Quote:
Originally Posted by TracerX
Посмотреть сообщение
hello I've been facing a problem on my 39k~ line code, there's a recursion
why is that problem?
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
how do I use it? I added profile_gamemode 1 in m server.cfg and used the include/plugin, nothing gets printed.
Quote:
Originally Posted by OneDay
Посмотреть сообщение
why is that problem?
I believe it lags my server
Reply
#5

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?
Reply
#6

If you're using new compiler (the fast one) you need to put #pragma disable recursion under #include <a_samp>
Reply
#7

Quote:
Originally Posted by Logic_
Посмотреть сообщение
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..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)