淺析Windows環境下堆表的空閑雙向鏈表結構

來源:互聯網
上載者:User

標籤:鏈表   soft   mem   microsoft   clu   cal   操作   pack   alt   

  • 實驗環境:
    • 作業系統: Windows 2000 Service Pack 4
    • 整合式開發環境: Microsoft Visual C++ 6.0 SP6
  • 實驗代碼如下:
  •  1 #include <windows.h> 2 #include <stdio.h> 3  4 int main(int argc, char **argv) 5 { 6     HLOCAL h1, h2, h3, h4, h5, h6; 7     HANDLE hp; 8     hp = HeapCreate(0, 0x1000, 0x10000); 9     10     // 為了方便顯示堆的地址,這裡把它列印出來11     printf("Heap address: %p\n", hp);12 13     // 為了避免程式監測出調試器而是使用調試堆管理原則14     __asm int 315 16     h1 = HeapAlloc(hp, HEAP_ZERO_MEMORY, 3);17     printf("h1: %p\n", h1);18     h2 = HeapAlloc(hp, HEAP_ZERO_MEMORY, 5);19     printf("h2: %p\n", h2);20     h3 = HeapAlloc(hp, HEAP_ZERO_MEMORY, 6);21     printf("h3: %p\n", h3);22     h4 = HeapAlloc(hp, HEAP_ZERO_MEMORY, 8);23     printf("h4: %p\n", h4);24     h5 = HeapAlloc(hp, HEAP_ZERO_MEMORY, 19);25     printf("h5: %p\n", h5);26     h6 = HeapAlloc(hp, HEAP_ZERO_MEMORY, 24);27     printf("h6: %p\n", h6);28 29     HeapFree(hp,0, h1);30     HeapFree(hp,0, h3);31     HeapFree(hp,0, h5);32 33     HeapFree(hp, 0, h4);34 35     return 0;36 }

     

  • 根據

淺析Windows環境下堆表的空閑雙向鏈表結構

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.