Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Understanding how variables are stored

$
0
0

After my epic boxes or labels question, I decided to put those analogies aside for the moment and focus on the documentation.

On the memory layout page, it states:

The jl_value_t struct is the name for a block of memory owned by the Julia Garbage Collector, representing the data associated with a Julia object in memory.

Questions:

  1. Are Strings, Integers and Floating-Point Numbers objects?
  2. When I create and initialize a variable, for example weapon_damage = 50, is a struct is created in memory that stores the value ( jl_value_t), and type ( jl_typetag_t) ?
  3. What about the variable name associated with the value, where is that stored?

Consider this answer from Software Eng Stack Exchange that uses both a box and a label to describe what’s happening in memory when you declare and object. What I’m looking for is what happens in memory when you bind a variable name to a value.

6 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles