summary refs log tree commit diff stats
path: root/rust/hello-world/Cargo.toml
blob: 4d9f8bb064ee1af1b64db791ee81be417f43b643 (plain) (blame)
1
2
3
4
[package]
edition = "2018"
name = "hello-world"
version = "1.1.0"
olor: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
to dereference a heap allocation
  copy handle to stack
  perform lookup to stack

lookup x in *(ESP+4) of type (handle T)

  reg <- copy *(ESP+5) : (address T stack)
  payload alloc id <- copy *reg
  address alloc id <- copy *(ESP+4)
  compare payload alloc id, address alloc id
  jump if not equal to print stack trace and panic
  address <- add reg, 1

types:

  address T reg
  address T stack
  address T heap
  address T global

copy down this spectrum is not permitted, but up is.

addresses aren't allowed in types, globals and on the heap. Only handles.
addresses are only for temporary manipulations.


*(address T) <- copy T