CS 2150 Lecture Notes - Lecture 24: C Dynamic Memory Allocation, Directory Structure, Address Space

48 views3 pages

Document Summary

Lecture 24: memory hierarchy: static/dynamic allocation, can be placed on either the stack or the heap (usually on heap) Address space grows down" from the top (from 0xfffff . downwards: cannot outlive procedure return, handles function calls & returns. Static: space required is known before program starts (at compile time") Dynamic: space required is not known before the program starts i. ii: stack iii. iv. v, heap vi. vii. viii. ix. x. xi. xii. xiii. Fixed-size-block allocation: a free list of available blocks is kept, and the. Managed by programmer explicitly (in java, automatically done) To deallocate things within the heap, we need the address of that piece of data (use delete" with that pointer, in c use free") Compiled into the program"s code is a heap directory management routine. Subroutine is invoked f: os is consulted (requires switching context back to os, heap directory is examined (new space is determined i. somehow)

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