Resetting values
Hello,
I would like to know if it has any use to reset all variables that I assign to players upon their leaving. Would this make it easier on your memory? I'm asking because I got a bunch of variables and maybe this is a way to optimize the plugin. Code:
new flashlight[33] |
Re: Resetting values
The space is reserved as soon as that line is initialized if they're global or static.
If they're inside a function the memory is reset when the function ends. (I assume) |
Re: Resetting values
If they are global, just set them to zero when player disconnescts in client_disconnect.
|
Re: Resetting values
That will not release the memory.
|
Re: Resetting values
memory isn't really an issue with hlds
we're talking about kilobytes here, nowadays it's useless to save a couple of em what resetting all those values would do would increase cpu usage and nothing more if you don't need them null for the next player that joins on that slot, then don't if you already clear them when a client joins, don't as stated above, global and static variables reserve memory and it will never be released until the server is closed(or the map changes which I'm not sure of but as soon as new map starts same thing) |
Re: Resetting values
Alright thanks for all the information :)
|
| All times are GMT -4. The time now is 09:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.