Quote:
Originally Posted by SixTwin
Doesn't global variables take up a lot more memory then local ones to?
For example:
Code:
#include <amxmodx> #include <amxmisc> #define MAX_LIMIT 100 new gMax_limit = MAX_LIMIT
public plugin_init() { register_plugin("Somthing","Something","Sure") } public a_function(id) { client_print(id,print_chat,"Max limit is: %i", gMax_limit) }
Would it be better to register the variable in the function 'a_function' ?
|
Totally wrong, they take up the same amount of memory.
Global variables are much faster though, as they're not deleted/created/filled each time they're needed.
Like SweatyBanana said, however, the storage is retained throughout the plugin's execution (clearing it impossible, even setting it to 0 leaves it as unusable to other applications).
__________________