Skip to content

Commit b22dbcb

Browse files
committed
expand README
1 parent 84f5b1b commit b22dbcb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
Custom `malloc` implementation built as a shared library.
44

5-
This project also includes a few extras: thread safety, logging, dump helpers, `calloc`, `reallocarray`, and a simple test program.
5+
This project also includes thread safety, logging hooks, memory dump helpers, `calloc`, `reallocarray`, and a simple test program.
6+
7+
## How It Works
8+
9+
The allocator uses `mmap` to reserve memory regions and classifies allocations into tiny, small, and large buckets. Metadata for regions and allocations is tracked in linked lists, and the public allocator entry points are protected by a global mutex so the library can be used from multi-threaded programs.
10+
11+
The project also exposes debugging helpers such as `show_alloc_mem`, ASCII dumps, and hex dumps so it is easier to inspect how blocks are laid out.
612

713
## Build
814

@@ -22,6 +28,12 @@ make test
2228
LD_PRELOAD=./libft_malloc.so ls
2329
```
2430

31+
## Notes
32+
33+
- The shared library name is host-specific and symlinked as `libft_malloc.so`.
34+
- This is intended for Unix-like systems using `mmap`, `pthread`, and `LD_PRELOAD`.
35+
- `make test` builds the demo test binary; you can run it afterward with `./test`.
36+
2537
Reference tester:
2638

2739
- `https://gitlab.com/mmeisson_42/correction-tests/malloc`

0 commit comments

Comments
 (0)