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

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

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

時(shí)間:2025-06-04  來(lái)源:合肥網(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ī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:BISM3206代做、代寫(xiě)Python編程語(yǔ)言
  • 下一篇:COMP4233代做、代寫(xiě)Python/Java程序
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢(qián)_專(zhuān)業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢(qián)_專(zhuān)業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢(xún)服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢(xún)服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢(xún)外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢(xún)外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類(lèi)仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類(lèi)仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢(xún)服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢(xún)服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁(yè)版入口 目錄網(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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久天天躁狠狠躁夜夜躁2014| 国产福利不卡| 亚州欧美日韩中文视频| 欧美激情欧美激情在线五月| 久久夜精品香蕉| 久久成人精品视频| 国产精品久久久久免费| 久久九九全国免费精品观看| 国产成人精品在线观看| 久久久久久网站| 久久久久一本一区二区青青蜜月| 国产精品亚洲二区在线观看| 国产日产亚洲精品| 国产精品自拍合集| 超碰97人人人人人蜜桃| 91精品国产91久久久久久不卡| 99久热re在线精品视频| 68精品久久久久久欧美| 久久精品美女| 久久精品国产精品亚洲| 国产精品久久久久久一区二区| 国产精品二区二区三区| 欧美日韩福利视频| 亚洲精品国产suv一区88| 午夜精品免费视频| 日韩欧美99| 免费在线观看一区二区| 国模精品娜娜一二三区| 国产精品一区二区三区免费视频| 波多野结衣久草一区| 久久手机视频| 国产成人无码一二三区视频| 国产精品久久久久久久电影| 蜜月aⅴ免费一区二区三区 | 视频一区视频二区视频| 青青草成人网| 国产精品自产拍在线观看| 久久男人av资源网站| 久久av综合网| 国产精品免费久久久| 在线观看欧美一区| 日本三级中国三级99人妇网站| 男女视频网站在线观看| 成人国产精品一区二区| 日韩色av导航| 亚洲v国产v| 免费国产黄色网址| 国产经品一区二区| 国产精品久久久久久久久久久久久久| 亚洲一区三区电影在线观看| 欧美在线日韩在线| 97成人精品视频在线观看| 国产精品爽爽爽爽爽爽在线观看| 欧美日本国产在线| 欧美诱惑福利视频| 91精品久久久久久久久久另类| 国产精品美女免费看| 天堂v在线视频| 国产日韩欧美在线播放| 日韩中文综合网| 亚洲国产欧美不卡在线观看| 国产一区精品视频| 日韩综合视频在线观看| 日韩一级特黄毛片| 国产精品亚洲аv天堂网| 久久视频在线看| 日本精品一区二区三区在线播放视频| 成人3d动漫一区二区三区| 日韩中文第一页| 亚洲一区二区精品在线观看| 国产一区喷水| 国产精品偷伦视频免费观看国产| 五月婷婷一区| 成人免费观看a| 久热精品视频在线观看一区| 欧美久久电影| 久久久久日韩精品久久久男男| 亚洲欧洲日韩精品| 国产精品一 二 三| 色综合天天狠天天透天天伊人| 免费看欧美一级片| 国产精品普通话| 欧美日韩天天操| 久久精品国产一区二区三区日韩| 一区不卡字幕| 成人精品在线观看| 欧美激情一二区| 国产美女精品久久久| 美女精品视频一区| 国产精品一区免费观看| 欧美日韩成人网| 国产美女在线一区| 欧美区在线播放| 国产精品专区一| 中文字幕一区二区三区乱码| 国产精品自产拍在线观| 欧美精品成人在线| 成人一级生活片| 亚洲伊人第一页| 国产日产久久高清欧美一区| 欧美精品情趣视频| 国产伦视频一区二区三区| 三级精品视频久久久久| 欧美久久久久久| 久久综合久久八八| 国产欧美日韩综合一区在线观看| 久久99国产精品久久久久久久久| 国产欧美日韩综合精品二区| 欧美激情综合亚洲一二区| 成人av在线亚洲| 日韩.欧美.亚洲| 国产精品视频网站| 国产精品一区免费观看| 日本欧美视频在线观看| 色偷偷88888欧美精品久久久 | 成人国产精品日本在线| 亚洲v日韩v综合v精品v| 久久久久久久激情| 精品视频在线观看一区二区| 自拍视频一区二区三区| 国产成人激情小视频| 国产在线999| 亚洲三区视频| 91久久国产综合久久91精品网站 | 色中色综合影院手机版在线观看| 欧美极品欧美精品欧美| 国产精品老女人视频| 国产一区二区丝袜| 蜜臀久久99精品久久久无需会员| 国产精品永久免费| 综合久久国产| 久久久久久久久久久综合| 欧美性在线观看| 国产精品第二页| 成人av一级片| 热久久这里只有| 久久久噜噜噜www成人网| 韩国国内大量揄拍精品视频| 欧美日韩国产二区| 国产成人高潮免费观看精品| 欧美精品亚洲| 久久97久久97精品免视看| 久久精品日产第一区二区三区精品版| 欧美性大战久久久久xxx| 欧美日韩国产二区| 久久婷婷五月综合色国产香蕉 | 精品丰满人妻无套内射| 国产精品午夜一区二区欲梦| 亚洲一区中文字幕在线观看| 国产成人黄色av| 欧美污视频久久久| 在线丝袜欧美日韩制服| 深夜福利一区二区| 欧美精品一区二区三区免费播放| 污视频在线免费观看一区二区三区 | 国产精品久久久久久久电影| av一区二区三区在线观看| 奇米888一区二区三区| 国产精品丝袜久久久久久高清| 国产日韩在线免费| 日本a级片在线观看| 国产精品流白浆视频| 久久精品久久精品国产大片| 国产欧美日韩视频一区二区三区 | 亚洲自拍另类欧美丝袜| 国产精品久久久久7777| 国产精华一区二区三区| 国产特级黄色大片| 日本精品免费视频| 国产精品日韩高清| 国产日产欧美精品| 国产自产精品| 热re99久久精品国99热蜜月| 一本色道久久99精品综合| 国产精品欧美一区二区| yellow视频在线观看一区二区| 欧美日韩午夜爽爽| 欧美一区二区视频97| 中文字幕一区二区三区四区五区| 国产精品无码乱伦| 久久综合一区二区三区| 国产精品永久免费| 美女精品国产| 日韩高清专区| 熟妇人妻va精品中文字幕| 美女999久久久精品视频| 国产成人精品一区二区| 久久久国内精品| 91精品久久香蕉国产线看观看| 99视频免费播放| 成人一级生活片| 国产乱码一区| 国产区亚洲区欧美区| 日本高清视频免费在线观看| 亚洲不卡中文字幕无码| 国产999精品视频| 国产精品乱码一区二区三区| 久久精品视频免费播放| 91高跟黑色丝袜呻吟在线观看| av不卡在线免费观看|