五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

cmu15-213 csapp 總結(jié)

2023-08-09 14:29 作者:敲推理  | 我要投稿

csapp的總結(jié)(還是一年前學的。。。)


lecture1--4

整數(shù)和float。整數(shù)主要是補碼表示,float就是IEEE標準,這是他們的底層表示。
unsigned與int轉(zhuǎn)換,不改變底層bit,還是那些bit,只是對bit的處理改變。而float與int轉(zhuǎn)換,則是根據(jù)原來的值,產(chǎn)生新的bit值。


lecture5--9

這部分主要是匯編指令入門,如果做了相應的lab、聽了課,就差不多了

  1. alignment(lectrue8)
    主要對于結(jié)構(gòu)體


struct rec { ? ?char c; ? ?int i[2]; ? ?double v;} *p;unaligned:c(1字節(jié))i[0](4)i[1](4)v[8]aligned:c(1)free(3)i[0](4)i[1](4)free(4)v[8]

aligned data要求數(shù)據(jù)是k字節(jié),其地址必須是k的倍數(shù);
如果是多個struct相鄰,aligned要求是struct地址必須是k的倍數(shù),k是自己內(nèi)部所有數(shù)據(jù)中k最大的那個;

同樣,可以重排,改變順序,節(jié)省浪費空間

  1. buffer overflow(lec9)
    a. 如gets的bug, 進而注入代碼等
    防護:棧的起始位置隨機、canary等
    b. return-oriented programming attacks

  2. big endian little endian(lec9):用于多字節(jié)對象
    例如假設上述變量x類型為int,位于地址0x100處,它的值為0x01234567,地址范圍為0x100~0x103字節(jié),其內(nèi)部排列順序依賴于機器的類型。大端法從首位開始將是:0x100: 0x01, 0x101: 0x23,..。而小端法將是:0x100: 0x67, 0x101: 0x45,..。


lecture10--optimization

因為compiler能力有限,不能無限優(yōu)化代碼

  1. 將某個函數(shù)的返回值,存儲下來,避免循環(huán)里多次調(diào)用、以及循環(huán)里的乘法等。如果學過compiler知道,compiler是有限的,沒必要把一切交給不那么智能的compiler處理

  2. 等等,見ppt,這部分不是那么重要,因為這你也記不住


lec11-lec12(memory)

  1. locality(temporal spatial)

  2. Cache: A smaller,faster storage device that acts as a staging area for a subset of the data in a larger, slower device.

  3. cache miss(cold miss, conflict miss, capacity miss)

  4. cache organization(lec12)


  1. direct mapped cache(E=1)

  2. write with cache
    write hit:
    write-through(write immediately to memory)
    write-back(defer write to memory until replacement of line)
    write miss:
    Write-allocate (load into cache, update line in cache)
    No-write-allocate (writes straight to memory, does not load into cache)

write-through + no-write-allocate
write-back+write-allocate

  1. 矩陣乘法的優(yōu)化(lec12最后)


lec13(linking)



格式為ELF


  1. linker symbols:global symbols/ external symbols/local symbols(static)

  2. static library \ shared library(at load time\run time)


lec14--15(ecf)




lec16(io)

unix io(read(), write()...)(unbuffered)
standard io(printf()...)(buffered)

  1. linux file(csapp 943)

shared file(open twice)


after fork


lec17--20(vm)


  1. vm in linux(csapp 867頁)

  2. malloc


summary

csapp內(nèi)容很繁雜,很多細節(jié)可能一問或者多想就會出錯,而csapp自身在廣不在深。所以想解決深度問題,可能就需要更進一步學習更深入知識,而csapp不行。

比如linking那里的static library和shared library,elf等等,你不自己實操看源碼就很難體會,光靠csapp這本書的理論知識不太夠,所以我也就不想太細扣了。打算放下這些問題,進行深入學習了。等把更深入的知識學會,這些問題應該也就不再是問題了,或者是很easy的問題了。

所以吸收csapp的知識作為基礎、內(nèi)功,學習更深入的就行了,這門課就至此徹底結(jié)束了。


cmu15-213 csapp 總結(jié)的評論 (共 條)

分享到微博請遵守國家法律
涪陵区| 塔河县| 漳州市| 丹阳市| 家居| 工布江达县| 宣武区| 长顺县| 比如县| 巨鹿县| 岱山县| 卓资县| 江阴市| 习水县| 广安市| 仁寿县| 江城| 新安县| 商水县| 海原县| 龙岩市| 南投市| 剑阁县| 天等县| 山东省| 临武县| 尉氏县| 灵寿县| 手机| 泗洪县| 岢岚县| 莒南县| 利川市| 孙吴县| 昆山市| 社旗县| 洛隆县| 晴隆县| 探索| 奇台县| 津南区|