Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cur의 위치를 전역변수
g_cur
로 보존한 뒤에find_fit
호출 시 처음부터 탐색하는 것이 아니라g_cur
의 위치부터 탐색을 시작합니다.coalesce
prev일 때에만
g_cur
를 수정했는데, 그러지 말고 모든 경우의 수에 해당하는 free block의 위치를g_cur
에 할당을 해 주어야 합니다. 예를 들어 next만 가용이고 prev가 채워져 있는 경우일지라도 일단g_cur = bp
를 해 주어야만 overlap이 일어나지 않더라구요.next_fit
void *
비교연산은 굳이char *
로 바꾸지 않아도 가능하다는 사실.g_cur
에서 출발해epliogue
로 도착하는 반복문 하나,prologue
에서 출발해g_cur
로 도착하는 반복문 하나, 이때 언제나 allocate 여부를 조사하기 때문에g_cur
를 항상 가용 블럭으로 줄 필요가 없습니다.place
모든
mm_malloc
작업의 마지막을 장식하는 place에서 g_cur의 값을 바꿔주었습니다.