Allocating Zero or Less Memory in CvXMLLoadUtility...

Keep in mind that the message is programmer-controlled and in this case quite wrong. The assert is checking that the string XML key in slot iI is a valid CivicType by passing it to getInfoTypeForString(). This says to me that one of the civics specified in that array is using the wrong XML key (typo?).

Okay, I think I found the typo. However, is there a way to make the error differentiate between a misspelled Civic and a memory leak?
 
Just change the message in quotes ("") to say "Invalid civic XML type" or something like it. The memory leak message is just a copy-n-paste leftover. Someone copied the FAssertMsg() call but didn't change the message to be appropriate.
 
Just change the message in quotes ("") to say "Invalid civic XML type" or something like it. The memory leak message is just a copy-n-paste leftover. Someone copied the FAssertMsg() call but didn't change the message to be appropriate.

Sure, but those messages are just for debug builds. How does the game generate those XML Load Call Failure Messages?
 
What are "those XML Load Call Failure Messages"? Remember, I don't do any XML hacking so I'm unfamiliar with how BTS reports errors. The little I've done just results in a CTD when there's an error, and I delete the file and start over. ;)
 
What are "those XML Load Call Failure Messages"? Remember, I don't do any XML hacking so I'm unfamiliar with how BTS reports errors. The little I've done just results in a CTD when there's an error, and I delete the file and start over. ;)

Type in garbage for a building type and see what happens. That's the error I would like to see.

Oh, and it's not XML hacking. It's modding. ;)
 
Actually EF, this is definatly one of those things you'd need to see. It's pretty easy to do though, just put in Garbage for any XML string in one of the main Infos files, and try to start up the mod you did that for. I also think those errors come from the .exe and not the gamecore.
 
Can you just tell me seeing as you're asking for my help? :)

Yeah... One sec, multitasking is killing my efficiency.

Also, I went through and double-checked all the XML for the AND Prereq and I still get the memory leak assert.

Edit:

Phungus beat me to it, and I agree with him. I can't believe you've never seen a Load Call error before. Your not a real modder till you get one. :p
 
Actually depending on what comes next, that could be a memory error. If the next line uses the getInfoTypeFor to place an item into an array, then you have a memory overflow, if it is set up intelligently to IGNORE a negative result though, there is no actual issue and the Assert is just information for the modder (though if it was set up with such an IF statement, you would imagine the Assert to be placed in the ELSE section, not on a line for itself)


EDIT: To be Clear:

Good:
Code:
FAssertMsg(GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI]) >= 0, "Warning, about to leak memory in CvBuildingInfo::readPass3");
int iTempIndex = GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI]);
if (iTempIndex >= 0 && iTempIndex < GC.getNumCivicInfos())
    PrereqAndCivic[iTempIndex] = true;

Bad:
Code:
FAssertMsg(GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI]) >= 0, "Warning, about to leak memory in CvBuildingInfo::readPass3");
PrereqAndCivic[GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI])] = true;
 
Actually depending on what comes next, that could be a memory error. If the next line uses the getInfoTypeFor to place an item into an array, then you have a memory overflow, if it is set up intelligently to IGNORE a negative result though, there is no actual issue and the Assert is just information for the modder (though if it was set up with such an IF statement, you would imagine the Assert to be placed in the ELSE section, not on a line for itself)


EDIT: To be Clear:

Good:
Code:
FAssertMsg(GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI]) >= 0, "Warning, about to leak memory in CvBuildingInfo::readPass3");
int iTempIndex = GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI]);
if (iTempIndex >= 0 && iTempIndex < GC.getNumCivicInfos())
    PrereqAndCivic[iTempIndex] = true;
Bad:
Code:
FAssertMsg(GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI]) >= 0, "Warning, about to leak memory in CvBuildingInfo::readPass3");
PrereqAndCivic[GC.getInfoTypeForString(m_aszPrereqAndCivicsforPas s3[iI])] = true;

Uh.. good thing you posted, mine was set up the "bad" way. I'll change it for both arrays right now.
 
Been playing realism invictus and not modding or messing with xml or sdk in at all. The game worked fine the last night. Today i'm getting the "Allocating zero or less memory message". Help?

Do you play with SVN or 3.1?
 
Back
Top Bottom