It is currently March 29th, 2024, 12:04 am

How stuff works. (RAM handling)

General topics related to Rainmeter.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

How stuff works. (RAM handling)

Post by kyriakos876 »

Hello, I was wondering how Rainmeter handles variables.
My question is as follows:

I have 10 skins.
In each skin's .ini file I have a variable X=1.
If I put those 10 variables into one .inc file instead of adding them locally in every skin, would that reserve less RAM or wouldn't it make a difference? (don't stick on whether the size reserved in the RAM is too small or not, I just wanna know what happens.)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How stuff works. (RAM handling)

Post by jsmorley »

kyriakos876 wrote:Hello, I was wondering how Rainmeter handles variables.
My question is as follows:

I have 10 skins.
In each skin's .ini file I have a variable X=1.
If I put those 10 variables into one .inc file instead of adding them locally in every skin, would that reserve less RAM or wouldn't it make a difference? (don't stick on whether the size reserved in the RAM is too small or not, I just wanna know what happens.)
It wouldn't make any difference. Loading a .inc file in a skin is exactly the same as if the code in the .inc file was in the skin .ini file itself, and everything in the .inc file is distinctly loaded and treated locally by the skin. There in nothing that is "shared" between skins.

The entire point of @Include is not about "sharing" anything between skins, but having a single place where you can "change" something, that is then distinctly used by various skins. So while it is tempting, and in fact common, to think of @Include as a way to "share" variables or other code between skins, it's more like a single common place to keep and change something, so that when various skins use it, they all are getting the same thing.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: How stuff works. (RAM handling)

Post by kyriakos876 »

Interesting... Thanks for sharing your knowledge once again :D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How stuff works. (RAM handling)

Post by jsmorley »

Glad to help. The entire concept of "global" in the programming sense, does not exist anywhere in Rainmeter.