well, it's not really an issue specific to AE's sdk, but rather a general programming principle.
i'll start with the good news:
no one will die if you'll use some global vars... especially if that data is constant and doesn't change once it's set.
global varibales are considered a bad practice for a few reasons:
1. it makes your code less readable, because functions rely on data other than the args passed into them.
so when reading your code, it won't be apparent how the result is reached via the passed args and you'll need to dive into the function.
2. it's might perform slower, because the cpu cache holds the passed args from one ram segment, and then needs to get the global vars from another ram segment.
3. in read/write scenrios, it means that your code is not multithreadable, or must require mutexes that take a performance tax.
4. it's just generally frowned upon.
having said that, i'll just note that WE ALL DO IT! yes, even the purists sectretly wat to "just store a couple of bytes"...
there are a couple of things to consider though:
1. if you're using std::vectors, you're not using AE's ram allocation but rather going straight to the system. it's highly recommended that you let AE decide about ram allocation and it's prioritization, so you won't eat more memory than AE wants to use. it's about the user's overall experience.
2. that global will be used by all instances of your effect. if you're cool with that, then fine.
3. that memory will be deallocated only when AE shuts down, even after global_setdown. so even if you allocated memory using AE's suites, at that time, you won't be able to release that memory using AE.
if you want to play nice, you can allocate some memory and store it in some pointer on your global_data handle. this would be the most "ram friendly" solution, and would give the appearance of a pro programmer that doesn't use global vars (THOGH WE ALL DO IT!!!).
... View more