21 January 2022

Stack vs. Heap

OS gives you space. 
You have the illusion that you are only app running
(virtual addressing)

stack:
    Manhattan
    function calls live here
    fixed size

heap:
    Des Moines: lots of storage
                access is slower

Python
    Objects live the heap.
    stack: holds variables
    What do variables store?  heap address (integer)
    function call activation records (stack frame)
    
0.  The global frame is created.
    
1.  Read function square into memory

global frame has square -> its code on the heap.

2.  Read function cbe into memory

global frame has;
    sqsuare -> its code on the heap.
    cube -> its code on the heap.
    



data warehouse

Primitive vs. Object

Objects

Classes