Skip to content

Memory Model

Andrew Johnson edited this page Nov 25, 2024 · 3 revisions

The LSTS memory model consists of sequences of flat strongly-typed memory regions. All LSTS objects have a size at runtime and that size is filled with bytes of typed data.

What is a typed memory region?

When we say that a region is strongly-typed we may not know very much or anything at all about that region. We know that it has a size and maybe nothing else. The type is just a way of representing everything that we do know.

What is open / closed data?

When we have logical access to a memory region, that region is said to be "open." If we do not have logical access to a memory region, that region is said to be "closed." It is possible to know about a memory region, but not to have logical access.

Example open / closed pointers

One of the simplest examples of open/closed data is pointers. If we have a pointer, that data is said to be closed from that reference. When we dereference that data we are opening that data to retrieve logical access.

Example open / closed lifetimes

The rules of open/closed data may at times be more complicated. Linear ownership tracking is an example of a slightly more intricate access model.

If we open a file to read, then we are opening that file pointer resource for certain logical access. When we close the file, it is no longer valid to read data from that resource. If we try to write to a read-only file pointer, that logical access is also closed.