COMPSCI 61C Lecture Notes - Lecture 6: Virtual Memory, C Dynamic Memory Allocation, Uninitialized Variable

18 views3 pages

Document Summary

O ce hours: monday 1 pm - 2 pm. We assume one program runs at a time, with access to all of memory. Virtual memory lets multiple programs all run at the same time, each thinking they own all of the memory. Program"s address space contains 4 regions: stack: local variables inside functions, grows downward heap: space requested for dynamic data via malloc() resizes dynamically, grows upward static data: variables declared outside functions, does not grow or shrink. Loaded when program starts, can be modi ed code: loaded when program starts, does not change. If declared outside a function, allocated in static storage. If declared inside function, allocated on the stack and freed when function returns main() is treated like a function. For both of these types of memory, the management is automatic. Every time a function is called, a new frame is allocated on the stack.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents