diff --git a/.zk/notebook.db b/.zk/notebook.db index 528394e..d80a3ed 100644 Binary files a/.zk/notebook.db and b/.zk/notebook.db differ diff --git a/zk/Stack_and_heap_memory.md b/zk/Stack_and_heap_memory.md deleted file mode 100644 index fb7b1c0..0000000 --- a/zk/Stack_and_heap_memory.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: 1fig -title: Stack_and_heap_memory -tags: [memory] -created: Tuesday, April 16, 2024 ---- - -# Stack and heap memory - -During runtime programs make use of two types of memory: stack and heap. - -## Stack memory - -Similarly to the stack data structure works on hte basis of LIFO: the last item -put on the stack is the first item to be withdrawn. - -## Related notes diff --git a/zk/Stack_memory.md b/zk/Stack_memory.md new file mode 100644 index 0000000..edcd9b5 --- /dev/null +++ b/zk/Stack_memory.md @@ -0,0 +1,29 @@ +--- +id: 1fig +title: Stack_memory +tags: [memory] +created: Tuesday, April 16, 2024 +--- + +# Stack memory + +Along with heap memory, programs make use of _stack memory_ during the runtime +of programs. + +## Stack memory + +Similarly to the [[stack data structure]], it works on the basis of LIFO: the +last item put on the stack is the first item to be withdrawn. + +Note, this doesn't mean that the data at the memory addresses that comprise the +stack can _only_ be accessed in a LIFO manner. Any item currently on the stack +can be accessed (be read or modified) at any time. LIFO applies when it is is +time to clear memory from the stack: the most recent addition is cleared first. + +### Stack pointer + +A **stack pointer** is used to manage the items in the stack. This value is +stored in a [[processor register]] and its value is the memory address of the +item currently on the top of the stack. + +## Related notes