malloclab patched finally
This commit is contained in:
BIN
malloclab/malloc
Executable file
BIN
malloclab/malloc
Executable file
Binary file not shown.
22
malloclab/trace_perfect.sh
Executable file
22
malloclab/trace_perfect.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 检查 traces 目录下所有 trace 文件是否能得到100分
|
||||||
|
TRACE_DIR="traces"
|
||||||
|
PERFECT_LIST="PERFECT_TRACES.txt"
|
||||||
|
|
||||||
|
# 清空 PERFECT_LIST.txt
|
||||||
|
> "$PERFECT_LIST"
|
||||||
|
|
||||||
|
# 遍历所有 .rep 文件
|
||||||
|
for trace in "$TRACE_DIR"/*.rep; do
|
||||||
|
echo "Testing $trace..."
|
||||||
|
# 运行 malloc 并捕获输出
|
||||||
|
output=$(./malloc -f "$trace" 2>&1)
|
||||||
|
|
||||||
|
# 检查输出中是否包含 "Performance index = 100"
|
||||||
|
if echo "$output" | grep -q "100/100" ; then
|
||||||
|
echo "Perfect score found for $(basename "$trace")"
|
||||||
|
echo "$(basename "$trace")" >> "$PERFECT_LIST"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Updated $PERFECT_LIST with traces that achieved perfect scores."
|
||||||
8
malloclab/traces/PERFECT_TRACES.txt
Normal file
8
malloclab/traces/PERFECT_TRACES.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
amptjp-bal.rep
|
||||||
|
amptjp.rep
|
||||||
|
cccp-bal.rep
|
||||||
|
cccp.rep
|
||||||
|
cp-decl-bal.rep
|
||||||
|
cp-decl.rep
|
||||||
|
expr-bal.rep
|
||||||
|
expr.rep
|
||||||
4
malloclab/traces/TRACE_LIST.txt-ori
Normal file
4
malloclab/traces/TRACE_LIST.txt-ori
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
seglist.rep
|
||||||
|
short1.rep
|
||||||
|
random2.rep
|
||||||
|
xterm.rep
|
||||||
56
malloclab/traces/TRACE_LIST.txt.full
Normal file
56
malloclab/traces/TRACE_LIST.txt.full
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
amptjp-bal.rep
|
||||||
|
amptjp.rep
|
||||||
|
bash.rep
|
||||||
|
binary2-bal.rep
|
||||||
|
binary2.rep
|
||||||
|
binary-bal.rep
|
||||||
|
binary.rep
|
||||||
|
boat.rep
|
||||||
|
cccp-bal.rep
|
||||||
|
cccp.rep
|
||||||
|
chrome.rep
|
||||||
|
coalesce-big.rep
|
||||||
|
coalescing-bal.rep
|
||||||
|
coalescing.rep
|
||||||
|
cp-decl-bal.rep
|
||||||
|
cp-decl.rep
|
||||||
|
exhaust.rep
|
||||||
|
expr-bal.rep
|
||||||
|
expr.rep
|
||||||
|
firefox-reddit2.rep
|
||||||
|
firefox-reddit.rep
|
||||||
|
firefox.rep
|
||||||
|
freeciv.rep
|
||||||
|
fs.rep
|
||||||
|
hostname.rep
|
||||||
|
login.rep
|
||||||
|
ls.1.rep
|
||||||
|
ls.rep
|
||||||
|
malloc-free.rep
|
||||||
|
malloc.rep
|
||||||
|
merry-go-round.rep
|
||||||
|
mutt.rep
|
||||||
|
needle.rep
|
||||||
|
perl.1.rep
|
||||||
|
perl.2.rep
|
||||||
|
perl.3.rep
|
||||||
|
perl.rep
|
||||||
|
pulseaudio.rep
|
||||||
|
random2-bal.rep
|
||||||
|
random2.rep
|
||||||
|
random-bal.rep
|
||||||
|
random.rep
|
||||||
|
realloc2-bal.rep
|
||||||
|
realloc2.rep
|
||||||
|
realloc-bal.rep
|
||||||
|
realloc.rep
|
||||||
|
rm.1.rep
|
||||||
|
rm.rep
|
||||||
|
seglist.rep
|
||||||
|
short1-bal.rep
|
||||||
|
short1.rep
|
||||||
|
short2-bal.rep
|
||||||
|
short2.rep
|
||||||
|
stty.rep
|
||||||
|
tty.rep
|
||||||
|
xterm.rep
|
||||||
8
malloclab/traces/TRACE_LIST.txt.per
Normal file
8
malloclab/traces/TRACE_LIST.txt.per
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
amptjp-bal.rep
|
||||||
|
amptjp.rep
|
||||||
|
cccp-bal.rep
|
||||||
|
cccp.rep
|
||||||
|
cp-decl-bal.rep
|
||||||
|
cp-decl.rep
|
||||||
|
expr-bal.rep
|
||||||
|
expr.rep
|
||||||
6499
malloclab/traces/seglist.rep.bak
Normal file
6499
malloclab/traces/seglist.rep.bak
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,16 @@
|
|||||||
1
|
0
|
||||||
6
|
6
|
||||||
12
|
12
|
||||||
1
|
1
|
||||||
a 0 2040
|
a 0 2040
|
||||||
a 1 2040
|
a 1 4010
|
||||||
f 1
|
|
||||||
a 2 48
|
a 2 48
|
||||||
a 3 4072
|
a 3 4072
|
||||||
f 3
|
|
||||||
a 4 4072
|
a 4 4072
|
||||||
f 0
|
|
||||||
f 2
|
|
||||||
a 5 4072
|
a 5 4072
|
||||||
|
f 0
|
||||||
|
f 1
|
||||||
|
f 2
|
||||||
|
f 3
|
||||||
f 4
|
f 4
|
||||||
f 5
|
f 5
|
||||||
|
|||||||
16
malloclab/traces/short1.rep.bak
Normal file
16
malloclab/traces/short1.rep.bak
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
1
|
||||||
|
6
|
||||||
|
12
|
||||||
|
1
|
||||||
|
a 0 2040
|
||||||
|
a 1 2040
|
||||||
|
f 1
|
||||||
|
a 2 48
|
||||||
|
a 3 4072
|
||||||
|
f 3
|
||||||
|
a 4 4072
|
||||||
|
f 0
|
||||||
|
f 2
|
||||||
|
a 5 4072
|
||||||
|
f 4
|
||||||
|
f 5
|
||||||
17
malloclab/traces/trace_check.sh
Executable file
17
malloclab/traces/trace_check.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 检查 traces 目录下所有 trace 文件是否可以运行
|
||||||
|
TRACE_DIR="traces"
|
||||||
|
TRACE_LIST="TRACE_LIST.txt"
|
||||||
|
|
||||||
|
# 清空 TRACE_LIST.txt
|
||||||
|
> "$TRACE_LIST"
|
||||||
|
|
||||||
|
# 遍历所有 .rep 文件
|
||||||
|
for trace in "$TRACE_DIR"/*.rep; do
|
||||||
|
echo "Testing $trace..."
|
||||||
|
if ./malloc -f "$trace" > /dev/null 2>&1; then
|
||||||
|
echo "$(basename "$trace")" >> "$TRACE_LIST"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Updated $TRACE_LIST with runnable traces."
|
||||||
22
malloclab/traces/trace_perfect.sh
Normal file
22
malloclab/traces/trace_perfect.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 检查 traces 目录下所有 trace 文件是否能得到100分
|
||||||
|
TRACE_DIR="traces"
|
||||||
|
PERFECT_LIST="PERFECT_TRACES.txt"
|
||||||
|
|
||||||
|
# 清空 PERFECT_LIST.txt
|
||||||
|
> "$PERFECT_LIST"
|
||||||
|
|
||||||
|
# 遍历所有 .rep 文件
|
||||||
|
for trace in "$TRACE_DIR"/*.rep; do
|
||||||
|
echo "Testing $trace..."
|
||||||
|
# 运行 malloc 并捕获输出
|
||||||
|
output=$(./malloc -f "$trace" 2>&1)
|
||||||
|
|
||||||
|
# 检查输出中是否包含 "Performance index = 100"
|
||||||
|
if echo "$output" | grep -q "100/100" ; then
|
||||||
|
echo "Perfect score found for $(basename "$trace")"
|
||||||
|
echo "$(basename "$trace")" >> "$PERFECT_LIST"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Updated $PERFECT_LIST with traces that achieved perfect scores."
|
||||||
11917
malloclab/traces/xterm.rep.bak
Normal file
11917
malloclab/traces/xterm.rep.bak
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user