Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Lecture Programming languages (2/e): Chapter 11 - Tucker, Noonan
Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Programming languages (2/e): Chapter 11 - Tucker, Noonan
Trọng Trí
91
21
ppt
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Chapter 11 - Memory management. This chapter discusses the implementation of dynamic arrays and other objects using conventional techniques for managing heap memory. Especially important in this context is the notion of heap overflow, along with strategies for dealing with heap overflow when it occurs at run time. We discuss three key algorithms for heap memory management, which are affectionately known as garbage collection algorithms. | Programming Languages 2nd edition Tucker and Noonan Chapter 11 Memory Management C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off. B. Stroustrup Contents 11.1 The Heap 11.2 Implementation of Dynamic Arrays 11.3 Garbage Collection 11.1 The Heap The major areas of memory: Static area: fixed size, fixed content allocated at compile time Run-time stack: variable size, variable content center of control for function call and return Heap: fixed size, variable content dynamically allocated objects and data structures The Structure of Run-Time Memory Fig 11.1 Allocating Heap Blocks The function new allocates a block of heap space to the program. E.g., new(5) returns the address of the next block of 5 words available in the heap: Stack and Heap Overflow Stack overflow occurs when the top of stack, a, would exceed its (fixed) limit, h. Heap overflow occurs when a call to new occurs and the heap does not have a large enough block available to satisfy the call. 11.2 Implementation of Dynamic Arrays Consider the declaration int A[n]; Its meaning (Meaning Rule 11.1) is: 1. Compute addr(A[0]) = new(n). 2. Push addr(A[0]) onto the stack. 3. Push n onto the stack. 4. Push int onto the stack. Step 1 creates a heap block for A. Steps 2-4 create the dope vector for A in the stack. Stack and Heap Allocation for int A[10]; Fig 11.3 Array References Meaning Rule 11.2 The meaning of an ArrayRef ar for an array declaration ad is: 1. Compute addr(ad[ar.index]) = addr(ad[0])+ar.index-1 2. If addr(ad[0]) addr(ad[ar.index])
TÀI LIỆU LIÊN QUAN
Lecture Programming languages (2/e): Chapter 12b - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 14a - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 15a - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 12d - Tucker, Noonan
Lecture Introduction to computing - Lesson 19: Programming languages
Lecture Programming languages (2/e): Chapter 12a - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 12c - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 13a - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 13b - Tucker, Noonan
Lecture Programming languages (2/e): Chapter 13c - Tucker, Noonan
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.