国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代做159.342 、代寫Operating Systems 編程設計
代做159.342 、代寫Operating Systems 編程設計

時間:2025-06-04  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



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.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp


 

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

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产精品亚洲一区二区三区| 蜜桃成人免费视频| 黄色特一级视频| 久久久久一区二区| 亚洲色精品三区二区一区| 蜜桃成人免费视频| 国产精品美腿一区在线看| 午夜精品久久久久久久久久久久| 国产欧美精品在线播放| 国产精品九九九| 欧美精品99久久| 久久精品电影网站| 人体精品一二三区| 久久久久久久久久网| 日本欧美一二三区| 国产黄色特级片| 欧美一区二区福利| 久久久久欧美| 日本wwww视频| 久久99精品久久久久久久久久 | 亚洲欧洲精品在线| 超碰免费在线公开| 自拍另类欧美| 97色在线播放视频| 亚洲AV无码成人精品一区| 91免费福利视频| 亚洲a一级视频| 国产高清在线精品一区二区三区| 日韩在线国产| 日韩在线免费高清视频| 欧美日韩精品免费看| 国产精品女人网站| 国产特级黄色大片| 欧美精品videos性欧美| 国产精品亚洲激情| 亚洲v国产v| 日韩在线免费观看视频| 激情深爱综合网| 久久艹在线视频| www.日本在线视频| 欧美一级片在线播放| 久久国产精品一区二区三区四区| 全黄性性激高免费视频| 国产精品天天狠天天看| 国产一区二区不卡视频在线观看| 色综合久久天天综线观看| 9a蜜桃久久久久久免费| 日本一区二区三区视频免费看| www.日韩不卡电影av| 欧美成人一区二区在线观看| 欧美精品在线播放| 国产精品av在线播放| 日韩免费黄色av| 久久这里有精品视频| 成人久久一区二区| 日韩五码在线观看| 欧美成人免费va影院高清| 97久久精品国产| 欧美在线3区| 欧美区二区三区| 久久另类ts人妖一区二区| 男人添女人下部视频免费| 九九热精品视频| 国产mv免费观看入口亚洲| 欧美在线免费观看| 欧美精品电影在线| 久久久久久亚洲精品不卡4k岛国 | 久久久久一本一区二区青青蜜月| 国产色视频一区| 日本香蕉视频在线观看| 欧美乱妇40p| 久久久久久久久久伊人| 国产免费黄色小视频| 日本一区二区三区视频免费看| 国产精品久久久久久久久久小说| 国产精品8888| 国产日韩欧美在线| 日韩亚洲欧美精品| 亚洲最大成人网色| 日韩中文视频免费在线观看| 国产精品专区在线| 欧美在线不卡区| 一卡二卡三卡视频| 色偷偷91综合久久噜噜| 成人免费视频91| 欧美日韩在线不卡视频| 亚洲欧美国产一区二区| 国产精品成人国产乱一区| 国产黑人绿帽在线第一区| 国产专区欧美专区| 日韩精品一区二区三区不卡| 亚洲综合中文字幕在线| 国产精品久久精品国产| 久草综合在线观看| 91精品国产电影| 国产女同一区二区| 免费看国产一级片| 欧美午夜性视频| 日本不卡在线观看| 午夜精品美女自拍福到在线| 久久91亚洲精品中文字幕奶水| 久久久99久久精品女同性| 久久久国产精品一区二区三区| 国产免费一区二区三区在线观看| 人妻无码视频一区二区三区| 亚洲精品9999| 欧美日韩成人黄色| 久久成年人视频| 国产精品久久久久久久乖乖| 日韩视频欧美视频| 久久一区二区三区欧美亚洲| 成人国产一区二区| 国产在线98福利播放视频| 欧美日韩免费高清| 日韩欧美亚洲在线| 大j8黑人w巨大888a片| 亚洲欧美日韩不卡一区二区三区| 欧美激情精品久久久久久黑人 | 国产女主播一区二区三区| 蜜桃成人免费视频| 狠狠干 狠狠操| 极品日韩久久| 黄色a级片免费| 激情小说网站亚洲综合网| 欧美 日韩 亚洲 一区| 欧美日韩二三区| 僵尸世界大战2 在线播放| 欧美亚洲精品日韩| 人妻久久久一区二区三区| 日本www高清视频| 日韩av综合在线观看| 亚洲国产精品www| 久久久久久91| 欧美激情亚洲一区| 中文精品视频一区二区在线观看 | 啊啊啊一区二区| 91精品在线观| 国产z一区二区三区| 丝袜美腿亚洲一区二区| 久久精品亚洲一区| 国产精品免费久久久久影院| 欧美另类69精品久久久久9999| 久久综合九色九九| 在线视频91| 天天干天天色天天爽| 日韩视频免费在线播放| 欧美 日本 亚洲| 美女亚洲精品| 国产欧美在线视频| 97精品视频在线| 久久乐国产精品| 久久好看免费视频| 久久国产精品影视| 亚洲制服欧美久久| 日韩中文一区| 欧美日本韩国国产| 国产人妻777人伦精品hd| 高清视频一区| 国产av人人夜夜澡人人爽麻豆| 日韩在线观看免费| 久久亚洲一区二区三区四区五区高| 欧美日韩国产成人| 欧美一区二区三区免费观看| 欧美二区在线视频| 99视频免费观看蜜桃视频| 国产成人97精品免费看片| 国产精品久久久久秋霞鲁丝| 欧美成人第一页| 亚洲精品成人久久久998| 欧美性猛交久久久乱大交小说| 国产日产欧美一区二区| 国产高清在线一区| 久久亚洲春色中文字幕| 午夜免费在线观看精品视频| 欧美凹凸一区二区三区视频| 成人黄动漫网站免费| 精品国偷自产在线视频| 亚洲一区二区精品在线| 欧美在线一区二区三区四区| 国产美女主播一区| 久久久久免费精品国产| 久久99精品久久久久久琪琪| 日本一级淫片演员| 国产区一区二区| www.欧美三级电影.com| 亚洲国产一区二区三区在线| 精品一区二区不卡| 久久久精品国产一区二区三区| 精品久久久三级| 欧洲精品在线一区| 91av免费观看91av精品在线| 精品乱子伦一区二区三区| 日韩欧美不卡在线| 91免费在线视频| 欧美成人亚洲成人日韩成人| 奇米一区二区三区四区久久| 97公开免费视频| 精品国产乱码久久久久久久软件| 日韩免费毛片| 国产脚交av在线一区二区|