[YSI] Inline + General
#21

Quote:
Originally Posted by Dayrion
View Post
---------------------
I still have a warning which I don't know how to solve:
[10:27:55] *** YSI Warning: y_malloc set up via "CallLocalFunction", memory corruption is a remote possibility
What "memory corruption" means? What should I do?
---------------------
Finally, I have one query inline which doesn't work. It is never called. Other inline callback are called.
PHP Code:
        mysql_format(databasequerysizeof(query), "SELECT * FROM `gtrp_factions_ranks` WHERE `FactionSQLID` = %i ORDER BY `gtrp_factions_ranks`.`Rank` ASC"j);
        
inline OnRanksLoading(factionID)
        {
            
J::D("Inside inline: %s"FactionInfo[j][fName], j);
            new 
temporary,
                
num_ranks cache_num_rows();
            if(!
num_ranks)
            {
                
CreateRanksForFactions(factionID);
                return 
J::D("No ranks loaded for %s. They have been created."GetFactionName(factionID));
            }
            for(new 
k!= num_ranksk++)
            {
                
cache_get_value_int(k"Rank"temporary);
                
cache_get_value(k"RankName"f_RankName[factionID][temporary], MAX_FAC_RANK_NAME);
                
J::D("Rank %i (%s) loaded for %s"temporaryf_RankName[factionID][temporary], GetFactionName(factionID));
            }
        }
        
J::D("Faction \"%s\" (id: %i) loaded | Loading ranks 2.0"FactionInfo[j][fName], j);
        
mysql_pquery_inline(databasequeryusing inline OnRanksLoading"i"j); 
No errors, no warnings, nothing in the logs
^ This inline callback seems to works randomly.
UP boyz!
Reply
#22

Quote:
Originally Posted by Y_Less
View Post
That warning comes when you use y_malloc from OnGameModeInit, but it is called by CallLocalFunction, which alters the heap. Try moving the YSI includes to after a_samp and before most other things (except fixes.inc).
Thanks again lol. I +rep you. I can't for Misiur, unfortunately.
Crashdetect must be included before too.
Reply
#23

Quote:
Originally Posted by Y_Less
View Post
Do you use "malloc" in OnGameModeInit? And that includes anything that uses "inline". If so, that might be a problem. However, I've thought of a new solution that solves two problems at once, including this one.
There is the correct order to avoid any warnings:
PHP Code:
#include <a_samp>
#include <profiler>
#include <crashdetect>
#define DYNAMIC_MEMORY 12500
#include <YSI\YSI\y_malloc>
#include <YSI\YSI\y_iterate>
#include <YSI\YSI\y_va>
#include <YSI\YSI\y_inline>
#include <fixes>
#include <a_mysql_yinline> 
No I don't directly use y_malloc. I include him for the other YSI's include.
Reply
#24

I was worried there was an issue with the new fast jump targets code, but I wasn't sure what. I've now determined what the issue is, so I've had to revert that code until a better solution can be found. So unfortunately for now your startups will have to go down again.
Reply
#25

Quote:
Originally Posted by Y_Less
View Post
I was worried there was an issue with the new fast jump targets code, but I wasn't sure what. I've now determined what the issue is, so I've had to revert that code until a better solution can be found. So unfortunately for now your startups will have to go down again.
Can't I keep the code until you find a better solution? The actual code can cause issues? If yes, what problems?
Thanks for your works, keep it up :p
Reply
#26

It is possible that the current code will keep working until I release my current YSI code. The issue was in the code responsible for tracking the size of the stack, but I don't think anything in the current version of YSI relies on that. I was just writing some new (well, modified old) code and needed the stack size information, which is what led me to realise that it was wrong.

So yes, you can probably keep using it for now. I'll try get a better solution before I release the new version, but since the current code works and only affects startup times, it isn't a high priority.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)