summaryrefslogtreecommitdiffstats
path: root/content/zettel/1b9a.md
blob: 7d2e8f577097d16210eba697194efda3b8b2cdba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
+++
title = "LegUp local memory support"
author = "Yann Herklotz"
tags = []
categories = []
backlinks = ["1b9"]
forwardlinks = ["1b9b"]
zettelid = "1b9a"
+++

LegUp supports local memories in functions by declaring the RAM's once
with their initial values. The main problem with this is that if the
function is called multiple times, but is using the same RAM underneath
to model it, it needs to be reset to the initial state whenever the
function is called.

Therefore only using the RAM initialisation to set the initial value is
not enough, and it therefore has to be initialised everytime the
function is called. This is done in LegUp by copying the memory from
another RAM over everytime.