From my understanding, the Stack is used to store value types (like Enumerations and Structures) and variables which are referenced to objects (like class instances) in the Heap. Furthermore, the Stack also holds function calls with their respective parameters and the like in a LIFO manner.
In C, there are 4 generic memory segments (Heap, Stack, Data, Code) where the Data segment(s) usually store the global and static variables which implies a completely separate aspect of memory where they are stored and managed, but I do believe Java handles it differently (with some magic on the part of the JVM).
How/where would a variable be stored if I declared a global variable in Swift? Would this be different if I simply played around with a Playground file, for example, compared to declaring a global/static variable/function in a project module in XCode?