mfunyu / malloc

Find out the workings behind optimum memory management and recode it, as well as free and realloc.
2 stars 0 forks source link
42cursus 42second-circle

malloc

Use bonus compilation to enable all features

ft_malloc

mandatory

compilation

make

usage

bonus

! does not work with multi-threaded programs

compilation

  make fclean
  make bonus

environments

Tests

single tests

usage

test details

Test no. Name Details
0 basic test Nmallocs -> Nfrees : malloc multiple size in all size regions, and free them all at the end. Check most basic allocations.
1 basic test1 malloc -> free -> malloc : malloc the exact same size region just after the free of the same size chunk.
2 basic test2 malloc -> wirte -> read : malloc ereas and write and read from them to varify if it works.
3 tiny test Nmalloc : malloc as much as possible with tiny allocation size.
4 small test Nmalloc : malloc as much as possible with small allocation size.
5 large test Nmalloc : malloc as much as possible with large allocation size.
6 basic realloc test malloc -> realloc : realloc malloced ptr with different sizes and check there contents.
7 freelists test mallocx2 -> free : malloc twice each time and free the first one to allow them to be stored in a freelist.

benchmark tests

./test/benchmark.sh

Google Test