Closed mfunyu closed 6 months ago
$> time ./test/run_test.sh 3
run 3
gcc -I includes -I libft -I ft_printf -I . ./test/correction/test3.c -Llibft -lft -Lft_printf -lftprintf libft_malloc_x86_64_Linux.so -o correction
===== test3 Large Test: Nmalloc =====
Error: mmap failed - size 12530991104
malloc 11230 times, total over 140723017700000 bytes
./test/run_test.sh 3 8.36s user 0.19s system 99% cpu 8.598 total
test3.c
version -> d84792e73f78318164d7c7824df714893ec0e5b0
The list must be doubly linked to avoid loop O(N). However, adding another header bk
to a large block creates chaos.
With the difficulty of testing, the time reduced until 0.11s
$> time ./test/run_test.sh 3
run 3
gcc -I includes -I libft -I ft_printf -I . ./test/correction/test3.c -Llibft -lft -Lft_printf -lftprintf libft_malloc_x86_64_Linux.so -o correction
===== test3 Large Test: Nmalloc =====
Error: mmap failed - size 12530991104
malloc 11229 times, total over 140710486710000 bytes
./test/run_test.sh 3 0.11s user 0.13s system 93% cpu 0.261 total
===== test3 Edge-Case Test: Nmalloc ===== Error: mmap failed - size 12530991104 malloc 11230 times, total over 140723017700000 bytes ./test/run_test.sh 3 6.59s user 0.14s system 99% cpu 6.759 total