AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run time error: Heap Low (https://forums.alliedmods.net/showthread.php?t=332554)

Shadows Adi 05-18-2021 13:49

Run time error: Heap Low
 
Hello,
I tried to format a ML String using fmt()

PHP Code:

05/18/2021 20:36:20: [AMXXDisplaying debug trace (plugin "most_valuable_player.amxx"version "1.9")
05/18/2021 20:36:20: [AMXXRun time error 8heap low
05
/18/2021 20:36:20: [AMXX] [0most_valuable_player.sma::Clcmd_ChooseTrack (line 1166)
05/18/2021 20:36:20: [AMXX] [1most_valuable_player.sma::mvp_menu_handle (line 1124

Here is the code:
Code:
if(g_bExistTracks)     {         for(new i; i < g_iTracksNum; i++)         {             ArrayGetArray(g_aTracks, i, eTrack)             if(i == g_iUserSelectedTrack[id])             {                 bUsed = true             }             else             {                 bUsed = false             }             // Here is the line 1166             formatex(szTemp, charsmax(szTemp), "\w%s %s \r%s", eTrack[szNAME], (eTrack[iVipOnly] == 1 ? fmt("%L", LANG_PLAYER, "MVP_VIP_ONLY") : ""), bUsed == true ? "#" : "")             menu_additem(menu, szTemp)         }     }

I did some research and this may be a compiler bug.
Code above decompiled:
Code:
if (g_bExistTracks)     {         new i;         while (i < g_iTracksNum)         {             ArrayGetArray(g_aTracks, i, eTrack, -1);             if (g_iUserSelectedTrack[id] == i)             {                 bUsed = true;             }             else             {                 bUsed = false;             }             new var1;             if (bUsed == true)             {                 var1 = 22792;             }             else             {                 var1 = 22800;             }             new var2;             if (eTrack[128] == 1)             {                 fmt("%L", -1, "MVP_VIP_ONLY"); /* ERROR! Can't print expression: Heap */  function "Clcmd_ChooseTrack" (number 31)

Napoleon_be 05-18-2021 15:01

Re: Run time error: Heap Low
 
I had some troubles with that aswell, you can find more info in my thread here: https://forums.alliedmods.net/showth...=170660&page=2

Shadows Adi 05-19-2021 00:57

Re: Run time error: Heap Low
 
Quote:

Originally Posted by Napoleon_be (Post 2747221)
I had some troubles with that aswell, you can find more info in my thread here: https://forums.alliedmods.net/showth...=170660&page=2

Thank you, but it won't work, because I need to print a ML Entry and some strings, as you can see in the code that I given.

Napoleon_be 05-19-2021 03:32

Re: Run time error: Heap Low
 
Perhaps you could share some more of your code? I've done some research and there was a bug found in 2006, but other than that, there's been a couple reports of this, but it's always been fixed by adjusting the code (adding a beauty check here or there).

Shadows Adi 05-19-2021 08:37

Re: Run time error: Heap Low
 
Quote:

Originally Posted by Napoleon_be (Post 2747266)
Perhaps you could share some more of your code? I've done some research and there was a bug found in 2006, but other than that, there's been a couple reports of this, but it's always been fixed by adjusting the code (adding a beauty check here or there).

Only that code have trouble, it seems working when I remove the condition operator:
PHP Code:

formatex(szTempcharsmax(szTemp), "\w%s %s \r%s"eTrack[szNAME], fmt("%L"LANG_PLAYER"MVP_VIP_ONLY"), bUsed == true "#" "")
menu_additem(menuszTemp

So, it's true, is a compiler bug that won't be fixed soon, isn't that?
In this case, I will leave it like it is: most_valuable_player.sma

Napoleon_be 05-19-2021 08:51

Re: Run time error: Heap Low
 
I'd suggest trying to upgrade to 1.10.

I just realized i made another thread about this a while ago, you might wanna check this out: https://forums.alliedmods.net/showthread.php?t=323270

DJEarthQuake 05-19-2021 14:05

Re: Run time error: Heap Low
 
Quote:

Originally Posted by Shadows Adi (Post 2747212)
[AMXX] Run time error 8: heap low

Any luck adjusting heap?

#pragma dynamic value

Shadows Adi 05-20-2021 07:30

Re: Run time error: Heap Low
 
Quote:

Originally Posted by DJEarthQuake (Post 2747293)
Any luck adjusting heap?

#pragma dynamic value

Thank you, but didn't worked on compiled script with 1.9.0 but

Quote:

Originally Posted by Napoleon_be (Post 2747280)
I'd suggest trying to upgrade to 1.10.

I just realized i made another thread about this a while ago, you might wanna check this out: https://forums.alliedmods.net/showthread.php?t=323270

on 1.10.0 it worked without any error, so it was a long standing compiler bug until 1.10.0 release. I will try some more methods to make the code more efficient, thank you all.


All times are GMT -4. The time now is 02:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.