freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

編譯原理-全動態(tài)內(nèi)存管理-文庫吧

2025-09-18 02:27 本頁面


【正文】 nce – Dynamic binding ? OO languages vary in their requirements for the runtime environment: – C++ retains the stackbased environment of C, no automatic dynamic memory management – Smalltalk requires fully dynamic environment similar to LISP Compiler Theory Fall 2021 Jianhui Yue Implementation of Objects ? Keep a plete description of the class structure in memory during execution. ? Maintain the inheritance by the superclass pointers. ? Keep pointers to all methods. ? Each object keeps: – Fields for instance variables – A pointer to its defining class ? All methods (local and inherited) are found through it. ? Instance variables have predictable offsets. ? Methods do not. They are maintained in a symbol table structure with lookup capabilities. Compiler Theory Fall 2021 Jianhui Yue Implementation of Objects (cont) ? An alternative approach is to pute a list of code pointers for methods of each class, and store this in (static) memory as a virtual function table. ? It can be arranged so that each method has a predictable offset. ? Each object contains a pointer to the appropriate virtual function table. ? It is the method of choice for C++. Compiler Theory Fall 2021 Jianhui Yue Example class A { public: double x, y。 void f()。 virtual void g()。 }。 class B: public A { public: double z。 void f()。 virtual void h()。 }。 x y Virtual function table pointer A::g x y Virtual function table pointer z A::g B::h Object A Object B Compiler Theory Fall 2021 Jianhui Yue Heap ? The data structure that handles pointer allocation and deallocation is called heap. ? Heap is usually allocated as a linear block of memory in a way that it can grow, while interfering as little as possible with the stack. ? Heap provides to operation 1. Allocate – Takes size parameter – Return a pointer to a block of memory of the correct size or null if none exists. 2. Free – Takes a pointer to an allocated block of memory – Marks it as being free – Must be able to find the size of the block. Compiler Th
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1