Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
1
1801_OS_assignment4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KimWooJeong
1801_OS_assignment4
Commits
ca74ccea
Commit
ca74ccea
authored
6 years ago
by
KimWooJeong
Browse files
Options
Downloads
Patches
Plain Diff
assignment4 submit
parent
a3c2ccde
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
alloc.c
+1
-7
1 addition, 7 deletions
alloc.c
main
+0
-0
0 additions, 0 deletions
main
main.c
+7
-7
7 additions, 7 deletions
main.c
with
8 additions
and
14 deletions
alloc.c
+
1
−
7
View file @
ca74ccea
...
...
@@ -18,14 +18,11 @@ void* m_malloc(size_t size)
end
=
start
;
}
if
(
end
==
start
)
{
block
=
-
1
;
}
meta
*
nextblk
=
end
;
end
+=
size
+
sizeof
(
meta
);
...
...
@@ -40,7 +37,6 @@ void* m_malloc(size_t size)
block
=
nextblk
;
printf
(
"%d %d "
,
nextblk
->
free
,
nextblk
->
size
);
...
...
@@ -59,8 +55,6 @@ void m_free(void *ptr)
}
}
void
*
m_realloc
(
void
*
ptr
,
size_t
size
){
//GG
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main
+
0
−
0
View file @
ca74ccea
No preview for this file type
This diff is collapsed.
Click to expand it.
main.c
+
7
−
7
View file @
ca74ccea
...
...
@@ -13,6 +13,11 @@ int main(int argc,char* argv[])
int
line_num
;
// 1,2,3,4,5
int
fit_type
=
0
;
if
(
argc
!=
2
)
{
printf
(
"!!!!!Usage: ./main input.txt
\n
"
);
return
0
;
}
FILE
*
fp
=
fopen
(
argv
[
1
],
"r"
);
...
...
@@ -39,7 +44,7 @@ int main(int argc,char* argv[])
return
0
;
}
char
**
lines
=
(
char
**
)
malloc
(
line_num
*
sizeof
(
char
*
));
char
**
lines
=
(
char
**
)
m_
malloc
(
line_num
*
sizeof
(
char
*
));
for
(
int
i
=
0
;
i
<
line_num
;
i
++
)
{
...
...
@@ -55,11 +60,6 @@ int main(int argc,char* argv[])
continue
;
}
}
//for(int i=0; i<line_num;i++)
//{
// printf("%s\n", lines[i]);
//}
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment