olehsamoilenko / malloc

This project is about implementing a dynamic memory allocation mechanism :floppy_disk:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

malloc

This project is about implementing a dynamic memory allocation mechanism
The first implementation was created accordingly to stepik guide.
Works on 🐧 Linux and 🍏 MacOS

Compile library

Clone: $ git clone --recursive https://github.com/olehsamoilenko/malloc.git
Compile: $ make
Compile debug version: $ make debug
Again usual version: $ make re

Run tests

To run tests please use: $ ./run.sh ./test
To show malloc performance please use:
$ ./run.sh /usr/bin/time -l ./test on 🍏 MacOS or
$ ./run.sh /usr/bin/time --verbose ./test on 🐧 Linux

Use library

$ gcc program.c [-lft_malloc -L .]
$ ./run.sh ./a.out

Features

  • memory defragmentation
  • unmap-ing unused pages
  • memory hexdump with show_alloc_mem_ex()
  • debug enviroment variable DEBUG
  • test framework: $ make debug && sh tests/run_tests.sh
  • integrated with ls: $ ./run.sh 'ls -lRa /' (sorry, only for 🍏 MacOS)
  • nm cleared of redundant functions

About

This project is about implementing a dynamic memory allocation mechanism :floppy_disk:


Languages

Language:C 79.1%Language:C++ 9.6%Language:Makefile 5.6%Language:Shell 3.8%Language:Objective-C 1.9%