[시뮬레이션] Memory management (first-fit, best-fit 시뮬레이션)
- 최초 등록일
- 2004.01.03
- 최종 저작일
- 2004.01
- 10페이지/ 압축파일
- 가격 1,500원
컴파일 실행환경
소스코드 및 실행파일.
데이터 파일 수록
본문내용
void simulation_first_fit(){
int alloc_index=0, dealloc_index, sp_dealloc = 0; // index for using memory allocation and deallocation
int alloc_block_size, dealloc_block_size, vtime; // size of allocated block, size of deallocation block, and virtual time
for(vtime = 0; vtime <= TotalSimulTime; vtime++){
if(AllocTime[alloc_index] == vtime){
AllocReqCount++;
if((alloc_block_size = allocation_first_fit(AllocSize[alloc_index])) == -1){ // if allocation request is failed
AllocFailCount++;
// if(CurAllocSize != 0)
SumOfExterFrag += (TOTAL_MEMORY_SIZE / CurAllocSize);
}
else{ // if allocation request is succeed
// if(RefBlockNumber != alloc_index)
// DeallocTime[RefBlockNumber-1] = DeallocTime[alloc_index];
TotReqSize += AllocSize[alloc_index];
TotAllocSize += alloc_block_size;
CurAllocSize += alloc_block_size;
압축파일 내 파일목록
dealloc_time_100.dat
project.out
project.c
alloc_time_10.dat
mem_size_1000.dat
mem_size_10000.dat
mem_size_5000.dat
project.exe
참고 자료
없음