加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

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

代做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程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

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

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

    日韩欧美在线精品| 视频一区视频二区中文| 精品一区二区三区四区五区| 日韩在线观看一区 | 99久久香蕉| 日本免费在线视频不卡一不卡二| 国产精品女主播一区二区三区| 亚洲97av| 久久精品国产一区二区| 欧美激情另类| 亚洲大全视频| 日本国产精品| 日韩精品视频在线看| 影音先锋亚洲精品| 福利一区二区免费视频| 成人激情开心网| 亚洲激情av| 欧美/亚洲一区| 国产精品对白| 久久不见久久见国语| 免费亚洲视频| 狠狠久久伊人中文字幕| 亚洲精品成人图区| 羞羞答答国产精品www一本| 国产91精品对白在线播放| 51亚洲精品| 日韩二区三区在线观看| 亚洲伦伦在线| 日日摸夜夜添夜夜添亚洲女人| 色狮一区二区三区四区视频| 欧美精品一卡| 欧美成人精品| 久久中文视频| 私拍精品福利视频在线一区| 99国产精品免费网站| 日韩av字幕| 欧美精美视频| 亚洲综合五月| 综合久久十次| 亚洲午夜精品一区 二区 三区| 欧美国产视频| 97精品国产综合久久久动漫日韩 | 青青国产91久久久久久| 国产成人77亚洲精品www| 国产超碰精品| 亚洲天堂一区二区| 精品三级久久| 国产精品第一| 欧美日韩va| 久久精品国产在热久久| 欧美成人aaa| 免费视频一区| 国产精品黄色| 国产激情综合| 疯狂欧洲av久久成人av电影| 亚洲狼人在线| 亚洲精品一级二级三级| 日韩黄色一级片| 日韩视频一区二区三区四区| 美女国产精品久久久| 大陆精大陆国产国语精品| 精品国产一区二区三区久久久蜜臀 | 亚洲影视一区二区三区| 青青国产精品| 国产精品麻豆成人av电影艾秋| 亚洲人体视频| 九色成人搞黄网站| 日本中文字幕视频一区| 一二三区精品| 一区二区三区日本视频| 最新国产精品视频| 综合视频一区| 成人午夜国产| 伊人久久亚洲热| 蜜臀精品一区二区三区在线观看| 蜜桃传媒麻豆第一区在线观看| 免费高清在线视频一区·| 国产精品13p| 国产69精品久久久久9999人| 日本不卡视频在线观看| 婷婷五月色综合香五月| 久久精品凹凸全集| 欧美在线网站| av日韩中文| 久久一区二区三区四区五区| 国产成人短视频在线观看| 蜜桃在线一区| 成人av国产| 国产精品蜜芽在线观看| 久久精品国产99国产精品| www.久久爱.com| 国产精品tv| 国产毛片久久| 青青草国产一区二区三区| 欧美激情视频一区二区三区在线播放 | 日本亚洲视频在线| 99久久婷婷| 蜜桃av一区二区三区电影| 久久三级毛片| 精品麻豆剧传媒av国产九九九| 精品美女久久| 免费在线观看不卡| 久久一日本道色综合久久| 日韩av中文字幕一区| 亚洲特色特黄| 正在播放日韩精品| 久久悠悠精品综合网| 国产精品对白久久久久粗| 国产一级久久| 久久久久久一区二区三区四区别墅| 在线看片一区| 国产福利资源一区| 日韩中文字幕一区二区三区| 精品美女一区| 91嫩草精品| 视频在线在亚洲| 一区二区国产精品| 国产精品久久久久久久久久白浆| 国产在线日韩| 欧美一级二级视频| 综合伊人久久| 蜜桃一区二区三区在线观看| 乱一区二区av| 91精品亚洲| 国产一区2区在线观看| 日韩精品导航| 美女久久一区| 亚洲色图网站| 加勒比久久综合| 色综合视频一区二区三区44| av不卡一区| 欲香欲色天天天综合和网| 欧美经典一区| 制服诱惑一区二区| 日本不卡的三区四区五区| 999视频精品| 亚洲综合av一区二区三区| 色悠久久久久综合先锋影音下载| 黄色亚洲精品| 亚洲狼人精品一区二区三区| 亚洲午夜极品| 精品久久毛片| 91精品一区二区三区综合| 国产成人77亚洲精品www| 欧美顶级毛片在线播放| 日韩国产综合| 欧美三区不卡| 综合久久2023| 9999久久久久| 日本精品在线一区| 久久久成人网| 久久精品久久久精品美女| 欧美日韩中文一区二区| 久久精品国产精品亚洲精品| 欧美亚洲在线日韩| 99精品视频网| 黄色成人在线网址| 国产亚洲字幕| 蜜臀久久99精品久久久久宅男 | 91精品动漫在线观看| 日本伊人午夜精品| 日韩视频在线一区二区三区| 国产精品日韩精品在线播放| 成人影院在线| 成人看片黄a免费看视频| 成人午夜亚洲| 午夜国产欧美理论在线播放| 精品一区二区三区在线观看视频| 久久国产精品久久w女人spa| 日韩电影一区二区三区| 男人天堂视频在线观看| 久久精品国产大片免费观看| 日本va欧美va精品| 亚洲一区不卡| 日本免费一区二区三区视频| 超碰这里只有精品| 一区在线免费观看| 日韩在线观看中文字幕| 国产第一亚洲| 亚洲一级在线| 综合欧美亚洲| 日本成人在线电影网| 免费看日韩精品| 六月丁香久久丫| 国产中文欧美日韩在线| 欧洲av不卡| 99综合在线| 精品国产一区二区三区av片 | 日本午夜精品久久久| 亚洲1234区| 女人天堂亚洲aⅴ在线观看| 日韩高清一级| 欧美在线观看天堂一区二区三区| 红桃视频国产一区| 大奶一区二区三区| av在线播放一区二区| 国产亚洲一区二区手机在线观看 | 亚洲第一福利社区| 成人黄色毛片| 免费成人美女在线观看|