加勒比久久综合,国产精品伦一区二区,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久久伊人| 婷婷亚洲五月色综合| 麻豆精品视频在线观看免费| 国产亚洲激情| 国产色噜噜噜91在线精品| 99精品免费视频| 亚洲综合电影一区二区三区| 日本超碰一区二区| 另类小说一区二区三区| 人人狠狠综合久久亚洲| 久久不见久久见国语| 桃色一区二区| 99pao成人国产永久免费视频| 日韩欧美天堂| 精品123区| 欧美日韩精品| 精品视频久久| 亚洲综合色网| 少妇高潮一区二区三区99| 日韩视频在线一区二区三区| 高清日韩中文字幕| 国产激情一区| 久久精品国产亚洲a| 蜜乳av一区二区| 国产一区清纯| 最新亚洲精品| 另类小说综合欧美亚洲| 日韩中文在线电影| 亚洲中字在线| 色婷婷狠狠五月综合天色拍| 亚洲影视一区二区三区| 手机看片久久| 日韩av在线播放网址| 日韩一级不卡| 成人在线视频免费观看| 欧美亚洲三级| 69堂免费精品视频在线播放| 丝袜美腿高跟呻吟高潮一区| 91精品观看| 综合视频一区| 国产成人精品999在线观看| 日韩高清在线不卡| 欧美国产一区二区三区激情无套| 仙踪林久久久久久久999| 麻豆精品国产| 偷拍一区二区| 国产调教一区二区三区| 亚洲国产欧美国产综合一区| 成人在线免费电影网站| 日韩专区欧美专区| 一区二区亚洲| 国产综合久久| 欧美美女一区| 欧美在线观看视频一区| 九九热播视频在线精品6| 激情综合五月| eeuss国产一区二区三区四区| 婷婷精品在线观看| 国产一区二区观看| 成人在线啊v| 免费观看亚洲天堂| 国产综合网站| 欧美国产91| av成人天堂| 免费观看30秒视频久久| 国产在线美女| 日本久久二区| 久久久久观看| 日韩av电影天堂| 禁断一区二区三区在线| 欧美日韩激情在线一区二区三区| 欧美精品黄色| 三级电影一区| 久久激五月天综合精品| 欧美精品福利| 日韩中文在线| 亚洲天堂黄色| 日本一本不卡| 国产精品一二| 久久99高清| 久久九九免费| 久久一二三区| 日韩三区四区| 国产欧美精品久久| 青青草91久久久久久久久| 精品一区三区| 色综合蜜月久久综合网| 精品久久美女| 天天av综合| 成人一级毛片| 丝袜美腿亚洲一区二区图片| 亚洲色图美女| 国产毛片久久久| 一区精品久久| 欧美日韩国产v| 综合久久十次| 美女呻吟一区| 免费一区二区视频| 久久精品国产免费看久久精品| 国产麻豆一区二区三区| 国产精品网在线观看| 自拍日韩欧美| a屁视频一区二区三区四区| 在线观看亚洲精品福利片| 国产福利资源一区| 午夜宅男久久久| 一区二区动漫| 精品久久不卡| 98精品久久久久久久| 亚洲欧洲日韩| 久久婷婷蜜乳一本欲蜜臀| a国产在线视频| **精品中文字幕一区二区三区| 美女av一区| 亚洲插插视频| 亚洲成aⅴ人片久久青草影院| 亚州av乱码久久精品蜜桃| av亚洲一区二区三区| 成人午夜888| 亚洲国产一区二区在线观看 | 亚洲精品国产偷自在线观看| 日韩欧美午夜| 色妞ww精品视频7777| 国产精品99在线观看| 欧美电影院免费观看| 99亚洲一区二区| 日本不卡视频一二三区| 女同一区二区三区| 日本另类视频| 国产精品videossex| 中文在线а√在线8| 亚洲三级性片| 老司机一区二区三区| 99综合久久| 狠色狠色综合久久| 国产精品大片| 亚洲美女少妇无套啪啪呻吟| 在线精品观看| 亚洲欧美色图| 综合天天久久| 午夜亚洲伦理| 久久综合欧美| 首页国产精品| 午夜视频一区二区在线观看 | 成人短片线上看| 亚洲区第一页| 国产一级久久| 亚洲美女15p| 三级中文字幕在线观看| baoyu135国产精品免费| 香蕉成人av| 伊人久久大香线蕉av不卡| 麻豆国产精品一区二区三区 | 国产精品粉嫩| 精品亚洲精品| 麻豆精品在线播放| 国产亚洲精品v| 亚洲最好看的视频| 久久av最新网址| 热久久久久久| 里番精品3d一二三区| 国产精品亚洲成在人线| 成人羞羞在线观看网站| 美女视频黄 久久| 99国产精品久久久久久久成人热 | 欧美日韩一二三四| 亚洲人成免费| 日韩激情精品| 亚洲天堂资源| 特黄特色欧美大片| 在线观看一区| 欧美激情国产在线| 秋霞一区二区| 美腿丝袜在线亚洲一区| 亚洲一区中文| 大奶一区二区三区| 国产欧美一区二区色老头| 91久久综合| 日韩免费电影在线观看| 国产美女久久| 美女日韩在线中文字幕| 国产suv精品一区二区四区视频| 日韩国产欧美视频| 视频在线不卡免费观看| 日韩精品欧美| 国产欧美一区二区精品久久久| 麻豆精品蜜桃| 首页欧美精品中文字幕| 成人免费电影网址| 国产a久久精品一区二区三区| 亚洲精品555| 天堂成人国产精品一区| 99精品全国免费观看视频软件| 国产欧美精品久久| 亚洲国产91|