Programming languages storage management
Stack-based Storage Management
• First Allocated - Last Freed.
• Simple storage recovery, compaction and
reuse.
• Not applicable if storage needs to be
allocated/freed at arbitrary points.
12 trang |
Chia sẻ: nguyenlam99 | Lượt xem: 929 | Lượt tải: 0
Bạn đang xem nội dung tài liệu Programming languages storage management, để tải tài liệu về máy bạn click vào nút DOWNLOAD ở trên
1
Programming Languages
Storage Management
Cao Hoàng Trụ
Khoa Công Nghệ Thông Tin
Đại Học Bách Khoa TP. HCM
2
Storage Management
• Major run-time elements requiring storage
• Major operations requiring storage to be
allocated/freed
• Storage management phases
• Storage management techniques
3
Run-time elements
• Code segments
• System run-time programs
library routines
storage management routines
• User-defined data structures
• Subprogram return points
4
Run-time elements
• Referencing environments
• Temporaries in expression evaluation
• Temporaries in parameter transmission
• Input-output buffers
• Miscellaneous system data
5
Run-time operations
• Subprogram call and return operations
• Data structure creation and destruction
operations
• Component insertion and deletion operations
6
Storage Management Phases
1. Initial allocation: allocating free storage
2. Recovery: recovering unused storage
garbage collection
3. Compaction and reuse:
compaction: to construct large blocks
reuse: as initial allocation
7
Storage Management Techniques
1. Static storage management
2. Stack-based storage management
3. Heap storage management
fixed-size elements
variable-size elements
8
Static Storage Management
Static allocation: allocation that remains fixed
through out execution.
9
Stack-based Storage Management
• First Allocated - Last Freed.
• Simple storage recovery, compaction and
reuse.
• Not applicable if storage needs to be
allocated/freed at arbitrary points.
10
Heap Storage Management
Heap: a block of storage within which data are
allocated/freed in an arbitrary manner.
11
heap
head
initial free-space list
heap
head
12
heap (storage allocated
by NEW)
typical Pascal memory organization
subprogram code segments
and system run-time routines
(statically allocated)
stack bottom
activation records
free space
heap bottom
Các file đính kèm theo tài liệu này:
- memory_1122.pdf