99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代做159.342 、代寫Operating Systems 編程設(shè)計(jì)
代做159.342 、代寫Operating Systems 編程設(shè)計(jì)

時(shí)間:2025-06-04  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



159.342 - Operating Systems and Networks
Assignment #3 (due on 6/Jun)
Memory Management Using the Buddy System Strategy
OBJECTIVE:
The main objective in this assignment is to implement the Buddy System memory management 
strategy by writing two functions that implement the same functionalities as the C Standard library’s 
malloc() and free(). You should apply your knowledge of memory management concepts, so the 
functions are as efficient as possible. The buddy system will be characterised and compared against 
the existing C Standard library functions based on ACTUAL RUNNING TIME and MEMORY USAGE. 
Given a large block of contiguous memory to manage, your functions should be able to fulfil a series 
of memory allocation and deallocation requests. In your implementation, you are not allowed to 
use the built-in malloc, free, new, delete or any other memory allocators that come from other 
third-party libraries. 
START-UP CODES:
The start-up codes provide a test routine that makes successive calls for memory allocations and 
deallocations, involving a replaceable implementation of MALLOC and FREE. Functions for 
measuring the actual running time and total memory usage of the memory management strategy
are also provided.
///////////////////////////////
// TEST ROUTINE
///////////////////////////////
#ifdef RUN_COMPLETE_TEST 
 cout << "\n\n executing " << NO_OF_ITERATIONS << " rounds of combinations of memory allocation and deallocation..." <<
endl;
 
 for(i=0;i<NO_OF_ITERATIONS;i++) {
 k=myrand() % NO_OF_POINTERS; // pick a pointer
 if(n[k]) { // if it was allocated then free it
 // check that the stuff we wrote has not changed
 if ( (n[k][0]) != (unsigned char) k)//(n[k]+s[k]+k) )
 printf("Error when checking first byte! in block %d \n",k);
 if(s[k]>1 && (n[k][s[k]-1])!=(unsigned char) k )//(n[k]-s[k]-k))
 printf("Error when checking last byte! in block %d \n",k);
 FREE(n[k]); 
 }
 size=randomsize(); // pick a random size
 #ifdef DEBUG_MODE
 cout << "\tPick random size to allocate: " << size << endl;
 #endif
 
 n[k]=(unsigned char *)MALLOC(size); // do the allocation
 if(n[k] != NULL){
 #ifdef DEBUG_MODE
 cout << "\tallocated memory of size: " << size << endl; 
 #endif 
 s[k]=size; // remember the size
 n[k][0]=(unsigned char) k; // put some data in the first and 
 if(s[k]>1) n[k][s[k]-1]=(unsigned char) k; // last byte
 } else {
 cout << "\tFailed to allocate memory of size: " << size << endl; 
 } 
 }
#endif
n.h.reyes@massey.ac.nz
Selecting a memory management strategy to test
You can switch between different memory management strategies by changing the definition of 
MALLOC and FREE, as defined inside main.cpp (see below). The first two options are already 
provided, but the third option corresponds to the Buddy System and therefore, needs to be 
implemented in this assignment:
//---------------------------------------
// WHICH MEMORY MANAGEMENT STRATEGY?
//---------------------------------------
// enable the following compiler directives to test the real malloc and free
//(1) use built-in C functions
const string strategy = "malloc";
#define MALLOC malloc
#define FREE free
//---------------------------------------
//enable the following compiler directives to test a simple implementation of malloc and free
//(2) use user-defined functions
//const string strategy = "mymalloc";
// #define MALLOC mymalloc
// #define FREE myfree
//---------------------------------------
//enable the following compiler directives to test your implementation of the Buddy system strategy
//(3) use Buddy System
// const string strategy = "Buddy System";
// #define USE_BUDDY_SYSTEM
// #define MALLOC buddyMalloc
// #define FREE buddyFree
//---------------------------------------
CORE FUNCTIONS REQUIRED:
Skeleton functions for buddy system’s malloc and free are already provided inside buddysys.cpp. 
Write your implementation inside them. You are allowed to add any supporting functions, data 
structures and variables in the program. 
void *buddyMalloc(int request_memory){
 //write your buddy system’s memory allocation codes here
 //this function should provide the same functionality as the malloc() function

int buddyFree(void *p){
 //write your buddy system’s memory deallocation codes here
 //this function should provide the same functionality as the free() function
}
AUXILIARY FUNCTIONS PROVIDED:
The Auxiliary functions, constants and data structures declared and implemented inside auxiliary.cpp 
and auxiliary.h should all be kept as is.
MINIMUM CONTIGUOUS MEMORY SIZE
As part of characterising the performance of your implementation, find the minimum contiguous 
memory size that allows the Buddy System strategy to accommodate the succession of memory 
allocation and deallocation requests in the test routine. To accomplish this, you need to experiment 
with different settings for the NUMBEROFPAGES until the test routine could be fully completed. 
Example: 
As an example, if you set NUMBEROFPAGES equal to 1024, then the MEMORYSIZE could be 
computed as follows:
// inside main.cpp
MEMORYSIZE = (long long int) ((long long int)NUMBEROFPAGES * (long long int)PAGESIZE);
Note that in the start-up codes, the PAGESIZE is set to 4096. Therefore, MEMORYSIZE will be equal 
to 4,194,304 bytes (1024 * 4096) or 4.19 MegaBytes. 
Next, with your MEMORYSIZE setting, run the test routines to see if all requests for memory 
allocations and deallocations can be satisfied. 
If the test routine cannot be completed, repeat the following steps until the test routine can be 
completed.
1. increase the MEMORYSIZE by a small amount, then recompile the code
2. run the test routine.
MEASURE OF PERFORMANCE
Download the Excel file, named assignment_documentation.xlsx from our stream website.
Characterise your Buddy System implementation and compare it against the C Standard library’s 
malloc and free to see if its speed of execution is comparable. Fill-up the Excel worksheet to 
document your experiment results. You only need to record the performance of your Buddy System 
implementation.
DEBUGGING:
For debugging purposes, I have created a simple test routine (inside the start-up codes) to assist the 
class. To activate this simple test temporarily, modify the auxillary.h file to enable 
RUN_SIMPLE_TEST as follows:
Before submitting your assignment, you should comment out #define RUN_SIMPLE_TEST and re activate #define RUN_COMPLETE_TEST again.
n.h.reyes@massey.ac.nz
n.h.reyes@massey.ac.nz
Further, inside main.cpp, I have made a provision for this Simple Test already, it will automatically 
switch to using 512 bytes as the MEMORYSIZE, to conduct the test.
For more details on how to debug your codes, please see the file, named 
A3_debugging_tips_2025_v1.docx. This is downloadable from our stream website.
SUBMISSION INSTRUCTIONS:
1. Submit your complete C/C++ program electronically via Stream. 
2. Use the following filename for your main program (as set in the start-up codes): main.cpp
3. Submit the makefile for building your codes. The makefile should suffice to build your 
codes.
4. As a backup, if you developed your program using an IDE, such as VSCODE or Clion, also 
submit the complete support files (e.g. CMakeLists.txt, project file, *.sln, *.JSON, etc.), for 
building your codes. 
5. Assignment documentation file: Download and fill out the Excel file, named 
assignment_documentation.xlsx to provide important information about your work. 
Rename the file using your ID_number (e.g. 87654321.xlsx). This will help facilitate 
accurate marking of your assignment. Deductions will be made if you do not submit the 
completed Excel file.
6. Snapshots file: Create a document containing snapshots of the simulation results. Show the 
results of executing RUN_COMPLETE_TEST. If this cannot be achieved, for partial marks, show 
the results of executing RUN_SIMPLE_TEST.
Label and briefly describe each image. You may create a Word document or a pdf file to 
accomplish this task.
7. Create a zip file containing the following files:
o Complete set of codes (including *.cpp, *.h, makefile, other supporting files)
o Snapshots file
8. Submit the zip file containing your complete program and snapshots electronically via 
Stream. You will find a button with the following label.
9. Submit the assignment documentation Excel file via Stream website. You will find a 
separate button with the following label.
10. Lastly, submit the Gen AI Usage documentation file via Stream website. You will find a 
separate button with the following label.
Distribution of marks:
The assignment will be marked based on functionality, design and correctness. 
The marks are distributed as follows:
• 5 marks: for correct implementation of buddyMalloc.
• 5 marks: for correct implementation of buddyFree.
• 3 marks: for memory efficiency (Note: this is based on the minimum contiguous memory 
size that allows the Buddy System strategy to accommodate the succession of memory 
allocation and deallocation requests in the RUN_COMPLETE_TEST routine)
• 2 marks: for documentation (i.e. accurate documentation of performance and other 
important assignment details - Excel assignment documentation, snapshots).
Other Notes
• This assignment is worth 15 marks. 
• Marks will be subtracted for obvious copying and/or for delays without justification.

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp


 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:BISM3206代做、代寫Python編程語言
  • 下一篇:COMP4233代做、代寫Python/Java程序
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評(píng)軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計(jì)優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開團(tuán)工具
    出評(píng) 開團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
  • 短信驗(yàn)證碼 trae 豆包網(wǎng)頁版入口 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                欧美成人一区二区三区| 日韩一区二区中文字幕| 欧美日韩中文国产| 亚洲一区二区三区小说| 7777精品伊人久久久大香线蕉经典版下载 | 91精品国产综合久久福利| 亚洲v精品v日韩v欧美v专区| 欧美成人video| 成人福利在线看| 亚洲成人免费看| 国产午夜一区二区三区| 91丨porny丨首页| 美女视频黄a大片欧美| 中文子幕无线码一区tr| 精品视频在线看| 国产伦精品一区二区三区免费 | 亚洲中国最大av网站| 3d成人h动漫网站入口| 亚洲va韩国va欧美va| 精品国产91乱码一区二区三区| 成人99免费视频| 视频一区二区国产| 国产午夜精品理论片a级大结局| 一本大道av伊人久久综合| 日本视频在线一区| 亚洲免费资源在线播放| 精品国产a毛片| 欧美日本在线一区| av中文一区二区三区| 美女一区二区在线观看| 一区二区三区四区不卡在线| 久久婷婷色综合| 8x8x8国产精品| 欧美羞羞免费网站| 色综合天天综合色综合av| 国产一区二区三区不卡在线观看| 污片在线观看一区二区| 一区二区三区在线视频播放| 国产精品无圣光一区二区| 欧美一区二区视频免费观看| 欧美日韩综合色| 欧美性色综合网| 一本大道av伊人久久综合| 国产成人aaa| 国产精品一级二级三级| 伦理电影国产精品| 日日夜夜一区二区| 午夜精品免费在线| 日韩中文字幕91| 久久国产尿小便嘘嘘尿| 美美哒免费高清在线观看视频一区二区| 亚洲成人免费视| 日本视频在线一区| 久久99久久99| 国产成人综合亚洲91猫咪| 国产经典欧美精品| 成人美女在线视频| 99久久99精品久久久久久 | av在线播放一区二区三区| 粉嫩av一区二区三区| 丁香婷婷综合激情五月色| 成人教育av在线| 色成年激情久久综合| 欧洲精品一区二区| 欧美剧在线免费观看网站 | 精品国精品国产| 国产清纯美女被跳蛋高潮一区二区久久w | 久久影音资源网| 久久久久久久久久久99999| 国产欧美一区二区三区网站| 中文字幕在线一区免费| 一区二区三区国产| 奇米影视7777精品一区二区| 丝袜国产日韩另类美女| 激情欧美日韩一区二区| 成人永久免费视频| 欧美体内she精视频| 精品少妇一区二区三区日产乱码| 国产香蕉久久精品综合网| 亚洲美女屁股眼交3| 免费在线一区观看| 成人激情综合网站| 欧美一区二区三区在线视频| 亚洲国产精品av| 亚洲无人区一区| 国产91综合一区在线观看| 日本高清视频一区二区| 精品国产sm最大网站免费看| 亚洲美女偷拍久久| 国产毛片精品国产一区二区三区| 在线欧美小视频| 日本一区二区三区国色天香| 亚洲国产cao| 不卡的av在线播放| 欧美zozo另类异族| 亚洲6080在线| 日本乱人伦aⅴ精品| 国产亚洲欧美在线| 麻豆国产精品官网| 欧美在线free| 国产精品人成在线观看免费| 麻豆精品久久精品色综合| 色综合久久久久综合99| 久久日韩粉嫩一区二区三区| 亚洲v日本v欧美v久久精品| 99久久精品一区二区| 久久久国产午夜精品| 丝瓜av网站精品一区二区| 色欧美片视频在线观看| 国产精品久久久久久久午夜片| 韩国女主播成人在线观看| 欧美日本一区二区三区| 亚洲精品视频在线观看免费| 国产激情视频一区二区三区欧美| 91精品国产色综合久久久蜜香臀| 亚洲一卡二卡三卡四卡无卡久久 | 亚洲一区二区视频在线| 国产很黄免费观看久久| 欧美电影免费提供在线观看| 亚洲小少妇裸体bbw| 欧美性欧美巨大黑白大战| 亚洲精品老司机| 欧洲精品中文字幕| 婷婷一区二区三区| 欧美精选一区二区| 日韩成人一级片| 欧美大胆人体bbbb| 激情图片小说一区| 精品久久人人做人人爽| 极品少妇xxxx精品少妇偷拍| 欧美精品一区二区在线播放 | 一本到不卡免费一区二区| 亚洲乱码日产精品bd| 日本国产一区二区| 午夜久久久影院| 欧美一区二区三区四区久久| 麻豆精品视频在线观看视频| 久久久www免费人成精品| 国产成人h网站| 自拍偷自拍亚洲精品播放| 色8久久精品久久久久久蜜 | 成人av在线影院| √…a在线天堂一区| 欧洲国内综合视频| 久久精品免费观看| 中日韩免费视频中文字幕| av不卡免费在线观看| 亚洲一二三四久久| 欧美xxxxx牲另类人与| 国产成人免费av在线| 国产欧美日韩精品一区| 91久久人澡人人添人人爽欧美| 亚洲第一av色| 久久综合九色综合久久久精品综合 | 国产成人精品免费在线| 亚洲男人电影天堂| 日韩免费成人网| 91视频你懂的| 久久精品免费观看| 亚洲精品欧美专区| 久久―日本道色综合久久| 在线观看一区二区精品视频| 精品一区二区三区香蕉蜜桃 | 另类小说综合欧美亚洲| 国产精品色婷婷久久58| 88在线观看91蜜桃国自产| 高清久久久久久| 日韩精品福利网| ●精品国产综合乱码久久久久| 日韩一区二区三区免费观看| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久精品国产免费| 亚洲色图20p| 精品欧美一区二区久久| 欧美亚洲综合另类| 成人免费三级在线| 精品一区二区三区免费| 午夜亚洲国产au精品一区二区| 国产精品久久久久影院色老大| 日韩久久久精品| 欧美美女黄视频| 欧美亚洲国产一区二区三区| 99久久综合99久久综合网站| 精品一区二区在线免费观看| 五月天网站亚洲| 一区二区三区影院| 国产精品久久午夜夜伦鲁鲁| 久久久久久日产精品| 欧美电视剧免费全集观看| 欧美天天综合网| 色婷婷狠狠综合| 91在线视频播放| 99久久伊人网影院| eeuss鲁片一区二区三区在线观看| 国产精品1024| 成人丝袜18视频在线观看| 成人h动漫精品一区二区| 不卡高清视频专区| 91麻豆国产在线观看| 一本色道久久综合亚洲精品按摩|