/liballoc

A Memory Allocator

Primary LanguageCMIT LicenseMIT

liballoc - Custom Memory Allocation Library

License

liballoc is a memory allocation library written in C that provides custom memory allocation and management functionality using a singly linked list data structure.

Features

  • Allocate and manage memory using a singly linked list.
  • Support for malloc, calloc, realloc, and free functions.
  • Thread-safe memory allocation using mutex locks.
  • Built-in overflow and error handling.

Usage

  1. Include the liballoc.h header file in your source code:
#include "liballoc.h"

Link your project with the compiled static or dynamic library.

Building the Library

  1. Clone this repository:
git clone https://github.com/your-username/liballoc.git
cd liballoc
  1. Build the library:
make

This will compile the library and generate both static (liballoc_$(ARCH)-$(OS).a) and dynamic (liballoc_$(ARCH)-$(OS).so) versions in the bin directory.

Contributing

Contributions are welcome! If you find any issues or want to add new features or improvements, feel free to open a pull request.

Acknowledgements

The core concepts and code structure of this library were adapted from the tutorial by Arjun Sreedharan: Memory Allocators 101 - Write a simple memory allocator.