Question info: about string.. memory usage
#1

for my gamemode.. I decided to use a global one string with 1024 characters, for all formats.. ecc.. is good, or waste a lot of resources in this way ?
Reply
#2

I'd say it's a waste. You might get in trouble with heap/stack size, because this will occupy memory for the whole gamemode execution. If you create local variables with new in smaller scopes, you can use smaller, adequate sizes for shorter strings, and they won't occupy resources for so long.
Reply
#3

That will be a huge waste of memory usage. Try to do 256 or 64.
Reply
#4

Global variables are not stored on the stack or the heap. It might just work, but it's somewhat of a dangerous practice because you might inadvertently overwrite the string before it is output.
Reply
#5

OK, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)