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

正文內容

編譯原理-全動態(tài)內存管理-全文預覽

2024-11-07 02:27 上一頁面

下一頁面
  

【正文】 inters. ? 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。Compiler Theory Fall 2021 Jianhui Yue Chapter 7 Dynamic Memory Parameter Passing Mechanisms Instructor Jianhui Yue Software College SCU Compiler Theory Fall 2021 Jianhui Yue Limitations of StackBased Environment ? If a reference to a local variable in a procedure can be returned to the caller, the result will be dangling reference. – When the procedure is exited, the activation record will be deallocated from the stack. ? addr = dangle() causes addr to point to an unsafe location. ? Such program is erroneous in C. – (No piler will give an error message) int *dangle() {int x。 void f()。 void f()。 unsigned nunits。 ? newp =p。 ? memptr=newp。 ? /* search the list to find the block containing ap */ ? prev+=p+p。 ++x。y)。} /* correct */ inc2(y)。 p(a,a)。 ++x。 return 0。 a[1]=1。} a has value of 3 after p is called if pass by reference is used. a has value of 2 after p is called if pass by valueresult is used. Compiler Theory Fall 2021 Jianhui Yue Pass by Name ? The idea is that the argument is not evaluated until its actual use in the called program. ? The name of the argument replaces the name of the parameter it corresponds to. int i。 ++y。 x) { ++x。 ++x。 ? memptr=prev。
點擊復制文檔內容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1